cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Pietro Tiaraju Giavarina dos Santos

Pietro Tiaraju Giavarina dos Santos's wiki page.

Pietro Tiaraju Giavarina dos Santos has authored 6 sequences.

A386929 a(n) is the least base b in {2,...,10} such that the base-b expansion of n, when read as a decimal integer, is prime; a(n) = 0 if no such base exists.

Original entry on oeis.org

0, 3, 2, 3, 2, 5, 4, 5, 6, 3, 4, 9, 4, 0, 6, 5, 4, 0, 4, 0, 5, 3, 2, 0, 6, 5, 6, 5, 4, 0, 7, 0, 5, 3, 8, 0, 4, 7, 6, 0, 5, 0, 4, 0, 6, 3, 2, 9, 8, 7, 0, 7, 4, 0, 4, 5, 8, 3, 7, 0, 4, 0, 5, 9, 8, 9, 3, 5, 0, 0, 4, 0, 4, 0, 8, 0, 4, 0, 3, 0, 5, 9, 4, 9, 7, 0, 6, 9, 2, 0, 4, 0, 6, 3, 8
Offset: 1

Keywords

Comments

There are infinitely many zeros since if n is a multiple of 2520, then each base-b expansion ends with digit 0.

Examples

			a(10) = 3 since 10 in base 3 is "101" and 101 is prime; base 2 is "1010" -> 1010 composite.
a(11) = 4 since base 4 gives "23" -> 23 is prime; base 2 "1011" -> 1011 composite; base 3 "102" -> 102 composite.
a(23) = 2 since base 2 gives "10111" -> 10111 is prime.
		

Crossrefs

Cf. A038537, A052026 (the zeros), A052033 (the tens).

Programs

  • Mathematica
    a[n_] := Block[{m}, Do[m = FromDigits[IntegerDigits[n, b], 10]; If[PrimeQ[m], Return[b]], {b, 2, 10}]; 0]
  • PARI
    a(n) = for(b=2, 10, if (isprime(fromdigits(digits(n, b))), return(b))); \\ Michel Marcus, Aug 09 2025

Formula

a(2520*n) = 0.

A384128 Number of iterations for the circular absolute first-difference on decimal digits to reach a repdigit.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 2, 3, 5, 6, 5, 6
Offset: 1

Keywords

Comments

a(n) = least t >= 0 such that the t-fold iteration of the circular absolute first-difference applied to the decimal digits of n yields a repdigit. The map sends n with decimal digits d_{k-1}...d_0 to the number whose digits are |d_{k-1}-d_{k-2}|, |d_{k-2}-d_{k-3}|, ..., |d_{0}-d_{k-1}|. Let F(n) = Sum_{i=0..k-1} |floor(n/10^i) mod 10 - floor(n/10^{(i+1) mod k}) mod 10|* 10^i. Then a(n) = min {t >= 0 : F^t(n) has all digits equal}.
a(n)=0 iff all decimal digits of n are equal.
a(n) <= 11 for n < 10000.

Examples

			The first value > 1 is a(100) = 3.
a(21) = |2-1| |1-2| = 11 -> repdigit at t = 1, so a(21) = 1.
a(109) = 109 -> 198 -> 817 -> 761 -> 156 -> 415 -> 341 -> 132 -> 211 -> 101 -> 110 -> 11 requires 11 steps, so a(109) = 11.
		

Crossrefs

Cf. A010785.

Programs

  • Mathematica
    SingleRepQ[x_Integer] := SameQ @@ IntegerDigits[x]
    CAD[x_Integer] := FromDigits@Abs[IntegerDigits[x] - RotateLeft[IntegerDigits[x]]]
    A384128[n_Integer] := Module[{x = n, cnt = 0}, While[! SingleRepQ[x], x = CAD[x]; cnt++]; cnt]
    Table[A384128[n], {n, 1, 200}]

Extensions

Data corrected by Sean A. Irvine, Jun 13 2025

A335332 Decimal representation of n-th iteration of the one-dimensional cellular automaton defined by Rule 954, based on the 4-celled von Neumann neighborhood starting with a single black cell.

Original entry on oeis.org

1, 11, 81, 699, 5441, 43723, 349265, 2797243, 22368577, 178961099, 1431651409, 11453263547, 91625951553, 733007821515, 5864061944913, 46912496398011, 375299968667969, 3002399752698571, 24019198011524177, 192153584105615035, 1537228672804655425, 12297829382490929867
Offset: 1

Keywords

Crossrefs

Cf. A334340.

Programs

  • Mathematica
    Table[DifferenceRoot[Function[{y, n}, {4872 + 32 y[n] + 28 y[1 + n] + 20 y[2 + n] + 21 y[3 + n] - 11 y[4 + n] - 7 y[5 + n] + y[6 + n] == 0, y[1] == 1, y[2] == 11, y[3] == 81, y[4] == 699, y[5] == 5441, y[6] == 43723, y[7] == 349265, y[8] == 2797243}]][n], {n, 1, 30}]
  • PARI
    Vec(x*(1 + 3*x - 11*x^2 + 39*x^3 - 124*x^4 - 12*x^5 + 96*x^6 + 2304*x^7 - 7168*x^8) / ((1 - x)*(1 + x)*(1 - 2*x)*(1 + 2*x)*(1 - 8*x)*(1 + x^2)) + O(x^40)) \\ Colin Barker, Jun 11 2020

Formula

G.f.: (-1 - 3*x + 11*x^2 - 39*x^3 + 124*x^4 + 12*x^5 - 96*x^6 - 2304*x^7 + 7168*x^8)/(-1 + 8*x + 4*x^2 - 32*x^3 + x^4 - 8*x^5 - 4*x^6 + 32*x^7).
a(n) = 8*a(n-1) + 4*a(n-2) - 32*a(n-3) + a(n-4) - 8*a(n-5) - 4*a(n-6) + 32*a(n-7) for n>9. - Colin Barker, Jun 11 2020

A334244 Decimal representation of n-th iteration of the one-dimensional cellular automaton defined by Rule 950, based on the 4-celled von Neumann neighborhood starting with a single black cell.

Original entry on oeis.org

1, 15, 81, 959, 5185, 61391, 331857, 3929023, 21238849, 251457487, 1359286353, 16093279167, 86994326593, 1029969866703, 5567636901969, 65918071468991, 356328761726017, 4218756574015439, 22805040750465105, 270000420736988095, 1459522608029766721, 17280026927167238095
Offset: 1

Keywords

Comments

a(n) is the decimal representation of the n-th step based on a simple initial condition, when a(1) = 1.

Crossrefs

Cf. A118171, A118173 (similar examples from elementary cellular automata).

Programs

  • Mathematica
    Table[((1607 +311*(-1)^n)*8^n -1040 +130*(-1)^n -1008*Sqrt[2]*Cos[(2*n-1)*Pi/4] )/8190, {n, 25}] (* G. C. Greubel, May 29 2020 *)
  • PARI
    Vec(x*(1 + 15*x + 17*x^2 - x^3) / ((1 - x)*(1 + x)*(1 - 8*x)*(1 + 8*x)*(1 + x^2)) + O(x^20)) \\ Colin Barker, Jun 10 2020

Formula

a(n) = (-1040 + 130*(-1)^n - (504 + 504*i)*(-i)^n - (504 - 504*i)*i^n + 1607*2^(3*n) + 311*(-1)^n*2^(3*n))/8190 where i = sqrt(-1).
G.f.: (1 + 15*x + 17*x^2 - x^3)/(1 - 64*x^2 - x^4 + 64*x^6).
From G. C. Greubel, May 29 2020: (Start)
a(n) = ( (1607 + 311*(-1)^n)*8^n - (1040 - 130*(-1)^n) - 1008*sqrt(2)*cos((2*n-1)*Pi/4) )/8190.
E.g.f.: (959*cosh(8*x) + 648*sinh(8*x) - 455*cosh(x) - 585*sinh(x) - 504*(cos(x) + sin(x)) )/4095.
(End)
a(n) = 64*a(n-2) + a(n-4) - 64*a(n-6) for n>6. - Colin Barker, Jun 10 2020

A334340 Decimal representation of n-th iteration of the one-dimensional cellular automaton defined by Rule 434, based on the 4-celled von Neumann neighborhood starting with a single black cell.

Original entry on oeis.org

1, 11, 81, 699, 5441, 43723, 349201, 2796731, 22364481, 178965195, 1431573521, 11453377723, 91624653121, 733009857227, 5864040961041, 46912529804475, 375299632087361, 3002400290556619, 24019192622879761, 192153592724761787, 1537228586572923201, 12297829520450964171, 98382633680004977681
Offset: 1

Keywords

Crossrefs

Cf. A118171, A118173 (similar examples from elementary cellular automata).

Formula

a(n) = (1428 + 7*(-4)^n + 2278*(-1)^n + (1800 + 360*i)*(-i)^n + (1800 - 360*i)*i^n - 3*4^n + 85*8^n)/510 where i = sqrt(-1).
G.f.: (-1 - 3*x + 23*x^2 - 3*x^3 + 40*x^4 + 624*x^5 - 1856*x^6)/(-1 + 8*x + 16*x^2 - 128*x^3 + x^4 - 8*x^5 - 16*x^6 + 128*x^7).

A276805 a(n) = numerator((n^2 + 3*n + 2)/n^3).

Original entry on oeis.org

6, 3, 20, 15, 42, 7, 72, 45, 110, 33, 156, 91, 210, 30, 272, 153, 342, 95, 420, 231, 506, 69, 600, 325, 702, 189, 812, 435, 930, 124, 1056, 561, 1190, 315, 1332, 703, 1482, 195, 1640, 861, 1806, 473, 1980, 1035, 2162, 282, 2352, 1225, 2550, 663, 2756, 1431, 2970, 385
Offset: 1

Keywords

Examples

			a(1) = numerator((n^2 + 3*n + 2)/n^3)  = 1^2+3*1+2/1^3 = 6.
		

Crossrefs

Cf. A277542.

Programs

  • Mathematica
    Table[Numerator[(n^2 + 3*n + 2)/n^3], {n, 1, 100}]
  • PARI
    a(n) = numerator((n^2 + 3*n + 2)/n^3); \\ Michel Marcus, Sep 18 2016
    
  • PARI
    Vec(x*(6 +3*x +20*x^2 +15*x^3 +42*x^4 +7*x^5 +72*x^6 +45*x^7 +92*x^8 +24*x^9 +96*x^10 +46*x^11 +84*x^12 +9*x^13 +56*x^14 +18*x^15 +30*x^16 +5*x^17 +12*x^18 +3*x^19 +2*x^20 +x^23) / ((1 -x)^3*(1 +x)^3*(1 +x^2)^3*(1 +x^4)^3) + O(x^100)) \\ Colin Barker, Oct 20 2016

Formula

From Colin Barker, Sep 18 2016: (Start)
a(n) = 3*a(n-8)-3*a(n-16)+a(n-24) for n>24.
G.f.: x*(6 +3*x +20*x^2 +15*x^3 +42*x^4 +7*x^5 +72*x^6 +45*x^7 +92*x^8 +24*x^9 +96*x^10 +46*x^11 +84*x^12 +9*x^13 +56*x^14 +18*x^15 +30*x^16 +5*x^17 +12*x^18 +3*x^19 +2*x^20 +x^23) / ((1 -x)^3*(1 +x)^3*(1 +x^2)^3*(1 +x^4)^3).
(End)
a(n) = a(n-8)*(n^2+3*n+2)/(n^2-13*n+42), for n>8. - Gionata Neri, Feb 25 2017