«arithmetic» etiketlenmiş sorular

Temel aritmetik ile ilgili zorluklar.

7
Sahte sahte Golf!
Giriş / Arka Plan Bir de son tartışmada yer kripto sohbet Birlikte / yardım görüşmek üzere meydan Fermat asallık testi ve Carmichael numaraları. Bu test a^(p-1) mod p==1her zaman primler için geçerli olacak p, ancak her zaman kompozitler için geçerli olmayan öncüllere dayanmaktadır . Bir dizi kendisi için: Artık bir …
9 code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

13
Expand Karşılaştırma Zincirleri
Çoğu dilden farklı a<b<colarak Python , boole a<bile karşılaştırmanın aksine, aslında üç sayıyı karşılaştırarak matematikte olduğu gibi değerlendirir c. Bunu C (ve diğerleri) yazmanın doğru yolu olurdu a<b && b<c. Bu meydan okumada, göreviniz keyfi uzunluklardaki bu tür karşılaştırma zincirlerini Python / sezgisel sunumdan diğer dillerde nasıl yazılacağına genişletmektir. Özellikler …
9 code-golf  parsing  conversion  syntax  code-golf  sequence  primes  code-challenge  geometry  optimization  code-golf  graph-theory  code-golf  number-theory  primes  integer  code-golf  source-layout  cops-and-robbers  code-golf  source-layout  cops-and-robbers  code-golf  sequence  primes  integer  code-golf  math  number-theory  primes  rational-numbers  code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

30
İnt girişi n verildiğinde, çıktı n * ters çevrilmiş (n)
Bir tam sayı verildiğinde n, çıktı alınn * reversed(n) reversed(n)reverserakamları ile elde ettiğiniz sayıdır n. reverse(512) = 215 reverse(1) = 1 reverse(101) = 101 >>>>>>>> func(5) = 5*5 = 25 func(12) = 12*21 = 252 func(11) = 11*11 = 121 func(659) = 659*956 = 630004 En kısa kod kazanır! Liderler …
9 code-golf  math  arithmetic  code-golf  math  integer  code-golf  arithmetic  integer  code-golf  sequence  base-conversion  palindrome  code-golf  math  primes  integer  code-golf  parsing  conversion  syntax  code-golf  sequence  primes  code-challenge  geometry  optimization  code-golf  graph-theory  code-golf  number-theory  primes  integer  code-golf  source-layout  cops-and-robbers  code-golf  source-layout  cops-and-robbers  code-golf  sequence  primes  integer  code-golf  math  number-theory  primes  rational-numbers  code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

15
Euler yöntemini uygulayın
Bu zorluğun amacı Euler yöntemini f (n) (x) = c biçimindeki diferansiyel denklemin çözümüne yaklaşmak için kullanmaktır . † Girişi, tam sayılar listesi olacak N inci değer f değerini temsil eder (n) (0). İlk tamsayı f (0), ikincisi f '(0), vb. Bu listedeki son tam sayı sabittir ve her zaman …

11
N sırasına kadar değişken grupların her bir kombinasyonunu oluşturun
ŞARTNAME Verilen mdeğişkenler, her kombinasyonu siparişe göre oluşturun n. Örneğin, İki değişkeni ( ave b) sırayla eşleme çıktısı 1şöyle olur: bir b ab İki değişkeni ( ave b) sırayla eşleme çıktısı 2şöyle olur: bir a 2 b b 2 ab a 2 b ab 2 a 2 b 2 İki …

2
En sık kullanılan on yüz kelime
Bu soru yazılmıştır, çünkü "Şey Açıklayıcı" okuması eğlenceli ve bana bir fikir verdi. Bir dizi harf, sayı ve bunun gibi şeyleri okuyan / alan "#%|?ve True / 1tüm sözcükler bu kümenin bir parçasıysa geri dönen "bilgisayarı bir şeyler yapan şeyler" yazın . Tüm kelimeler bu kümenin parçası değilse, parçası olmayan …
9 code-golf  string  parsing  code-golf  array-manipulation  random  permutations  code-golf  string  code-golf  parsing  code-golf  string  quine  code-golf  string  parsing  comment  code-golf  string  counting  natural-language  code-golf  string  decision-problem  code-golf  math  code-challenge  metagolf  test-battery  code-golf  string  code-golf  math  number  arithmetic  source-layout  code-golf  number  primes  decision-problem  code-golf  math  arithmetic  code-golf  date  code-golf  string  cryptography  code-golf  code-golf  chess  board-game  code-golf  geometry  grid  puzzle-solver  set-partitions  code-golf  number  natural-language  code-golf  ascii-art  code-golf  math  code-golf  string  ascii-art  kolmogorov-complexity  code-golf  string  natural-language  code-golf  game  board-game  tic-tac-toe  code-golf  ascii-art  hexagonal-grid  code-golf  string  comment  code-golf  internet  code-golf  sorting  code-golf  kolmogorov-complexity  unicode  code-golf  tips  code-golf  string  natural-language  code-golf  string  kolmogorov-complexity  source-layout  hello-world  code-golf  string  kolmogorov-complexity  counting  natural-language  code-golf  random  quine  code-golf  string  math  bitwise  code-golf  permutations  code-golf  string  code-golf  arithmetic 

7
Szekeres dizisi
Tanım a(1) = 1 a(2) = 2 a(n)içinde k>a(n-1)herhangi bir 3-dönemli aritmetik ilerlemeyi önleyen en küçük sayıdır a(1), a(2), ..., a(n-1), k. Başka bir deyişle, orada olmayan , nerede ve olmayan a(n)en küçük sayıdır .k>a(n-1)xy0<x<y<na(y)-a(x) = k-a(y) Çalışılan örnek Şunun için n=5: Sahibiz a(1), a(2), a(3), a(4) = 1, 2, …


3
Bir Tarihi Basitleştirin
Bu, kesirleri basitleştirmeye benzer, ancak Tarihler! Programınızın girişi şu biçimde olmalıdır mm/dd : Örneğin 3/4 //March 4 12/15 //December 15 1/1 // January 1 Girdinin, aylarda bu sayıda gün olacak şekilde geçerli olacağını varsayıyoruz: January 31 February 28 March 31 April 30 May 31 June 30 July 31 August 31 …

6
İki matrisin Kronecker toplamını hesaplayın
Aşağıdaki örneklerde Ave B2'ye 2 matris olacak ve matrisler bir indekslenmiştir. Bir Kronecker ürünü aşağıdaki özelliklere sahiptir: A⊗B = A(1,1)*B A(1,2)*B A(2,1)*B A(2,2)*B = A(1,1)*B(1,1) A(1,1)*B(1,2) A(1,2)*B(1,1) A(1,2)*B(1,2) A(1,1)*B(2,1) A(1,1)*B(2,2) A(1,2)*B(2,1) A(1,2)*B(2,2) A(2,1)*B(1,1) A(2,1)*B(1,2) A(2,2)*B(1,1) A(2,2)*B(1,2) A(2,2)*B(2,1) A(2,2)*B(1,2) A(2,2)*B(2,1) A(2,2)*B(2,2) Bir Kronecker toplamı aşağıdaki özelliklere sahiptir: A⊕B = A⊗Ib + …

3
Doğum numarasını doğrulayın
Norveç Doğum Numarası 11 basamaktan oluşur ve aşağıdaki şekilde oluşturulur: DDMMYYiiikk DD gün (01-31 arası) MM ay (01-12 arası) YYyıl (00-99 arası). 1900 ile 2000 arasında ayrım yapılmamıştır iii "bireysel numara" kk iki kontrol basamağı iii birthyearear ve cinsiyet tarafından aşağıdaki şekilde belirlenir 0000-1900: Yok say, bazı tutarsızlıklar ve özel …

2
Farklı taraflardan matematiksel bir ifade çözme
İfadenin alternatif kenarlarındaki öğeleri kullanarak matematiksel bir ifadeyi çözen bir program oluşturun. Yapılma şekli, soldan sağa okumak yerine, ilk karakteri, sonra sonuncuyu, sonra ikincisini, sonra ikincisini sonuncuyu vb. Okumanızdır. Bu, değerlendirmeniz ve çıkmanız gereken yeni bir ifade verecektir. a*b/c+d-e 135798642 <-- Order you read the expression in ae*-bd/+c <-- Order …

6
Kronecker sembolünü hesapla
Burada ve burada alakalı bağlantılar , ancak kısa sürüm: İki tamsayı var ave bnegatif sonsuzluk ile sonsuzluk arasında bir giriş var (gerekirse, aralığı sınırlayabilirim, ancak işlev yine de negatif girişleri kabul etmelidir). Kronecker sembolünün tanımı Sen Kronecker sembolünü geri dönmelidir (a|b)girişler için aveb (a|b) = (a|p_1)^e_1 * (a|p_2)^e_2 * ... …

2
Kalıtsal Üs Değişimi
Arka fon Bu meydan okumada, bir tamsayının taban btemsili , her terimin en çok meydana geldiği güçlerin toplamı olarak nifade nedilir . Örneğin, baz- temsili olanbb-142015 4^5 + 3*4^4 + 3*4^3 + 4^2 + 3*4 + 3 Şimdi, kalıtsal taban btemsili nüsleri taban btemsillerine dönüştürüp, üslerini dönüştürerek ve tekrar tekrar …

15
Dönüştürmeden dizelerin toplamı
Bu iki dizeleri toplamını 2 girdileri dize almak ve çıkış zorunda kalmadan int dönüştürerek veya herhangi bir sayısal veri türünü kullanarak. ex. string one = "123"; string two = "456"; string sum = "579"; Dizelerin 10 basamaktan büyük olmayacağını varsayalım. Bu kod golf ve karakterler kısa cevap kazanır. C # …
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.