Domande taggate «integer»

Per le sfide che coinvolgono la manipolazione di numeri interi.

8
Disegna un triangolo phi
Chiarimento: Fondamentalmente, è necessario fare questo La funzione totient di Euler ha il nome phi. Proviamo a calcolare il phi (8) Innanzitutto, elenca tutti i numeri 8 e precedenti all'indietro, escluso 0 o meno 8 7 6 5 4 3 2 1 Ora trova quali numeri non condividono un fattore …


9
Attraverso lo spazio e il tempo
Introduzione: In generale si parla di solito quattro dimensioni: tre dimensioni spaziali per x, ye z; e una dimensione temporale. Per il bene di questa sfida però, ci divideremo la dimensione temporale in tre così: past, present, e future. Ingresso: Due liste di input. Uno contenente x,y,zcoordinate intere e uno …

7
Di chi sono i vicini ostili?
introduzione Ai fini di questa sfida, definiremo i vicini di un elemento in una matrice quadrata (tale che ) come tutte le voci di che sono immediatamente adiacenti in diagonale, orizzontale o verticale a (cioè "circondano" , senza avvolgersi).A E = A i , j A EEEEUNUNAE= Aio , jE=UNio,jE=A_{i,j}UNUNAEEE …

6
È un numero soddisfacente?
ispirato a questa conversazione di chat Un numero soddisfacente è un numero la cui rappresentazione decimale è della forma abx, con le seguenti proprietà: xè il suffisso ripetuto finale più lungo o l'ultima cifra se non c'è ripetizione alla fine ( 123333-> 3333, 545656-> 5656, 123-> 3) bè la cifra …

3
Mappatura tra parola intera e pronunciabile
Scopo L'idea è di fornire il codice necessario per mappare un numero intero a 32 bit a / da una parola pronunciabile di massimo 9 caratteri. Ciò potrebbe essere utile, ad esempio, per semplificare la memorizzazione di un numero seriale o digitare un modulo. Sono richiesti sia il metodo per …

6
Numeri che sono palindromi in N basi
Dato un numero intero non negativo n >= 0, genera per sempre la sequenza di numeri interi x_i >= 3che sono palindromi in nbasi esattamente diverse b, dove può essere la base 2 <= b <= x_i-2. Questo è fondamentalmente l'inverso di OEIS A126071 , dove vengono emessi gli indici …
10 code-golf  sequence  base-conversion  palindrome  code-golf  array-manipulation  matrix  code-golf  string  ascii-art  code-golf  ascii-art  physics  code-golf  number  sequence  fibonacci  code-golf  ascii-art  packing  code-golf  string  hexadecimal  code-challenge  restricted-source  decision-problem  binary  code-golf  code-golf  code-golf  stack-exchange-api  code-golf  string  parsing  generation  data-structures  code-golf  kolmogorov-complexity  graphical-output  code-golf  array-manipulation  integer  generation  data-structures  code-golf  number  random  probability-theory  king-of-the-hill  java  minesweeper  code-golf  string  kolmogorov-complexity  animation  code-golf  string  code-golf  code-golf  quine  code-golf  internet  code-golf  arithmetic  base-conversion 

25
Calcola la velocità relativistica
Nella relatività speciale , la velocità di un oggetto in movimento rispetto a un altro oggetto che si muove nella direzione opposta è data dalla formula: s=v+u1+vu/c2.s=v+u1+vu/c2.\begin{align}s = \frac{v+u}{1+vu/c^2}.\end{align} s = ( v + u ) / ( 1 + v * u / c ^ 2) In questa formula, …

24
Undelta moltiplicativa
Definiamo i "delta moltiplicativi" dei valori come:[a0,⋯aN,][a0,⋯aN,][\; a_0, \cdots a_N, \;] [a1/a0,⋯,ai+1/ai,⋯,aN/aN−1][a1/a0,⋯,ai+1/ai,⋯,aN/aN−1] [\; a_1 / a_0, \cdots, a_{i+1} / a_i, \cdots, a_N / a_{N-1} \;] L'operazione inversa - vale a dire "undelta moltiplicativa" - restituisce valori tali che l'operazione sopra indicata risulta nei valori indicati. Esempio Valori dati una soluzione …

2
Suggerimenti per giocare a golf in The Powder Toy
Divertiti con questo, The Powder Toy è una sfida interessante per il golf, in particolare con la logica dei filtri. La cosa che rende TPT una sfida sono i molti molti molti molti modi per affrontare un problema: Should I use Cellular Automaton rules, SWCH logic, Filt logic, subframe filt …
9 code-golf  tips  the-powder-toy  code-golf  number  array-manipulation  integer  code-golf  string  decision-problem  boggle  code-golf  array-manipulation  average  code-golf  math  code-golf  decision-problem  restricted-source  code-golf  code-golf  math  primes  code-golf  random  code-golf  tips  perl  code-golf  string  parsing  code-golf  math  number  decision-problem  code-golf  math  number  code-golf  string  alphabet  code-golf  math  geometry  code-golf  interpreter  brainfuck  code-golf  code-golf  decision-problem  boggle  code-golf  math  number  sequence  code-golf  math  code-golf  ascii-art  code-challenge  restricted-source  quine  code-golf  math  decision-problem  number-theory  primes  code-golf  ascii-art  code-golf  integer  graph-theory  chess  code-golf  math  interpreter  code-golf  code-golf  code-golf  ascii-art  code-golf  arithmetic  number-theory  code-golf  string  kolmogorov-complexity  code-golf  string  decision-problem  code-golf  primes  factoring  encode  code-golf  decision-problem  code-golf  geometry  grid  code-golf  quine  code-golf  matrix  code-golf  matrix  code-golf  code-golf  number  array-manipulation  code-golf  array-manipulation  sorting  code-golf  matrix  code-golf  brain-flak 

17
Primi nella scomposizione in fattori primi
Ho visto un'altra sfida principale arrivare in PPCG e mi piacciono alcuni numeri primi. Poi ho letto male il testo introduttivo, e mi chiedevo che cosa avesse escogitato il cervello creativo qui. Si scopre che la domanda posta era banale, ma mi chiedo se lo stesso vale per la domanda …

7
Un treno attraversa un ponte etichettato
Considera un ponte di lunghezza B formato da tessere etichettate con le cifre degli interi positivi concatenati. Ad esempio, se B avesse 41 anni, sarebbe simile al seguente: ----------------------------------------- 12345678910111213141516171819202122232425 Ora immagina un treno di lunghezza T che attraversi il ponte. Il punto più a sinistra del treno inizia dalla …

7
Golf gli pseudoprimi!
Introduzione / Contesto In una recente discussione nella chat crittografica sono stato sfidato a discutere / aiutare con il test di primalità di Fermat e i numeri di Carmichael. Questo test si basa sulla premessa che a^(p-1) mod p==1sarà sempre valida per i numeri primi p, ma non sempre per …
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
Espandi catene di confronto
A differenza di molti linguaggi, Python valuta a<b<cin quanto sarebbe stato fatto nel campo della matematica, in realtà a confronto i tre numeri, al contrario di confrontare il booleano a<ba c. Il modo corretto di scrivere questo in C (e molti altri) sarebbe a<b && b<c. In questa sfida, il …
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
Dato un input int n, stampa n * invertito (n)
Dato un numero intero n, stampan * reversed(n) reversed(n)è il numero che ottieni quando hai reversele cifre di 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 Vince …
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 

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.