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.

Previous Showing 11-18 of 18 results.

A069800 Triangular array in which n-th row consists of numbers with digit sum n arranged in increasing numerical order.

Original entry on oeis.org

1, 2, 11, 3, 12, 21, 111, 4, 13, 22, 31, 112, 121, 211, 1111, 5, 14, 23, 32, 41, 113, 122, 131, 212, 221, 311, 1112, 1121, 1211, 2111, 11111, 6, 15, 24, 33, 42, 51, 114, 123, 132, 141, 213, 222, 231, 312, 321, 411, 1113, 1122, 1131, 1212, 1221, 1311, 2112, 2121
Offset: 1

Views

Author

Amarnath Murthy, Apr 13 2002

Keywords

Comments

0 is not allowed as a digit.
Row n has A104144(n+8) terms. - T. D. Noe, Oct 27 2008

Examples

			Triangle begins:
  1;
  2,11;
  3,12,21,111;
  4,13,22,31,112,121,211,1111;
  ...
		

Crossrefs

Cf. A069801.
Cf. A007953. [T. D. Noe, Oct 27 2008]

Programs

  • Mathematica
    Flatten[Table[p=Partitions[n,9]; Sort[Flatten[Table[FromDigits/@Permutations[p[[i]]], {i,Length[p]}]]], {n,6}]] (* T. D. Noe, Oct 27 2008 *)

Extensions

More terms from T. D. Noe, Oct 27 2008

A107247 Sum of squares of nonacci numbers (Fibonacci 9-step numbers).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 2, 6, 22, 86, 342, 1366, 5462, 21846, 87382, 348503, 1390944, 5552544, 22166320, 88491056, 353269040, 1410299184, 5630100784, 22476064048, 89727075632, 358201316657, 1429983219018, 5708667195022, 22789694921422
Offset: 0

Views

Author

Jonathan Vos Post, May 29 2005

Keywords

Comments

Primes in this sequence include: a(9) = 2, which is next? Semiprimes in this sequence include: a(10) = 6 = 2 * 3, a(11) = 22 = 2 * 11, a(12) = 86 = 2 * 43, a(14) = 1366 = 2 * 683, a(15) = 5462 = 2 * 2731, a(17) = 87382 = 2 * 43691, a(18) = 348503 = 37 * 9419, a(28) = 358201316657 = 71 * 5045088967.

Crossrefs

Programs

  • Mathematica
    Accumulate[LinearRecurrence[{1,1,1,1,1,1,1,1,1},{0,0,0,0,0,0,0,0,1},31]^2]  (* Ray Chandler, Aug 02 2015 *)

Formula

a(n) = F_9(0)^2 + F_9(1)^2 + ... F_9(n)^2, where F_9(n) = A104144(n).

A172319 10th column of A172119.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1023, 2044, 4084, 8160, 16304, 32576, 65088, 130048, 259840, 519168, 1037313, 2072582, 4141080, 8274000, 16531696, 33030816, 65996544, 131863040, 263466240, 526413312, 1051789311
Offset: 0

Views

Author

Richard Choulet, Jan 31 2010

Keywords

Crossrefs

Partial sums of A104144.

Programs

  • Maple
    for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od;
  • Mathematica
    LinearRecurrence[{2,0,0,0,0,0,0,0,0,-1},{1,2,4,8,16,32,64,128,256,512},40] (* Harvey P. Dale, Sep 22 2020 *)

Formula

G.f.: 1/(1-2*z+z^10).
a(n)=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))). a(n+10)=2*a(n+9)-a(n).

A073901 Number of primes with nonzero digits and digit sum n.

Original entry on oeis.org

0, 2, 1, 3, 7, 0, 29, 27, 0, 90, 234, 0, 753, 1025, 0, 3876, 9242, 0, 32549, 50112, 0, 180092, 420318, 0, 1525141, 2467286, 0, 9248093, 20668960, 0, 76318859, 130130794, 0, 487397935, 1066434006, 0
Offset: 1

Views

Author

Amarnath Murthy, Aug 18 2002

Keywords

Comments

a(3k) = 0 for all k>1.
The number of candidates to consider for a(n) (i.e. the number of integers with nonzero digits and digit sum n) is A104144(n+8). - Robert Israel, Jun 05 2015

Examples

			a(2) = 2: the two primes are 2 and 11. a(5) = 7: the primes are 5, 41, 23, 113, 131, 311 and 2111.
		

Crossrefs

Not the same as A116381.
Cf. A104144.

Programs

  • Maple
    S[1,1]:= [1]:
    for x from 2 to 9 do S[1,x]:= [] od:
    a[1]:= 0: a[2]:= 2:
    for n from 2 to 22 do
      for x from 2 to 9 do S[n,x]:= map(`+`,S[n-1,x-1],1) od:
      S[n,1]:= [seq(op(map(t -> 10*t+1, S[n-1,x])),x=1..9)];
      if n > 3 and n mod 3 = 0 then a[n]:= 0
      else
        if n > 5 then X:= [1,3,7,9] else X:= [$1..9] fi;
        a[n]:= add(numboccur(map(isprime,S[n,x]),true),x=X);
      fi
    od:
    seq(a[n],n=1..22); # Robert Israel, Jun 05 2015
  • Mathematica
    f[n_] := If[ Mod[n, 3] == 0 && n > 3, 0, Block[{ip = IntegerPartitions@ n, lng = 1 + PartitionsP@ n, cnt = 0, k = 1}, While[k < lng, If[ Max@ ip[[k]] < 10, cnt += Length@ Select[ FromDigits@# & /@ Permutations@ ip[[k]], PrimeQ]]; k++]; cnt]]; Array[f, 30] (* Robert G. Wilson v, Jun 05 2015 *)
    DigitSum[n_, b_:10] := Total[IntegerDigits[n, b]];nextodd[c_] := If[ Length[c]==2, Join[ Table[1, {c[[1]]-2}], {c[[2]]+2}], Join[ Table[1, {c[[1]]-1}], {c[[2]]+1}, Drop[c, 2]]]; a[2]=2; a[n_] := If[Mod[n, 3]==0 && n>3, 0, Module[{c, ct}, For[ c = Table[1, {n}]; ct = 0, True, c = nextodd[c], If[ PrimeQ[ FromDigits[c]] && DigitSum[FromDigits[c]]==n, ct++ ]; If[ c[[ -1]] >= n-1, Return[ct]] ] ]]; Table[ a[n], {n, 20}]
  • PARI
    See Links section.
    
  • Python
    from collections import Counter
    from sympy.utilities.iterables import partitions, multiset_permutations
    from sympy import isprime
    def A073901(n): return sum(1 for p in partitions(n,k=9) for a in multiset_permutations(Counter(p).elements()) if isprime(int(''.join(str(d) for d in a)))) if n==3 or n%3 else 0 # Chai Wah Wu, Feb 21 2024

Extensions

Edited and extended by Robert G. Wilson v, Sep 19 2002
a(20) to a(24) and alternate Mathematica coding from Dean Hickerson, Sep 21 2002
a(25) from Robert G. Wilson v, Sep 26 2002
a(26)-a(31) from Robert G. Wilson v, Nov 14 2005
Corrected and edited by Manfred Scheucher, Jun 01 2015
a(32)-a(33) from Rémy Sigrist, Nov 17 2022
a(34)-a(36) from Michael S. Branicky, Jul 03 2023

A105758 Indices of prime hexanacci (or Fibonacci 6-step) numbers A001592 (using offset -4).

Original entry on oeis.org

3, 36, 37, 92, 660, 6091, 8415, 11467, 13686, 38831, 49828, 97148
Offset: 1

Views

Author

T. D. Noe, Apr 22 2005

Keywords

Comments

No other n < 30000.
This sequence uses the convention of the Noe and Post reference. Their indexing scheme differs by 4 from the indices in A001592. Sequence A249635 lists the indices of the same primes (A105759) using the indexing scheme as defined in A001592. - Robert Price, Nov 02 2014 [Edited by M. F. Hasler, Apr 22 2018]
a(13) > 3*10^5. - Robert Price, Nov 02 2014

Crossrefs

Cf. A105759 (prime Fibonacci 6-step numbers), A249635 (= a(n) + 4), A001592.
Cf. A000045, A000073, A000078 (and A001631), A001591, A122189 (or A066178), A079262, A104144, A122265, A168082, A168083 (Fibonacci, tribonacci, tetranacci numbers and other generalizations).
Cf. A005478, A092836, A104535, A105757, A105761, ... (primes in these sequence).
Cf. A001605, A303263, A303264 (and A104534 and A247027), A248757 (and A105756), ... (indices of primes in A000045, A000073, A000078, ...).

Programs

  • Mathematica
    a={1, 0, 0, 0, 0, 0}; lst={}; Do[s=Plus@@a; a=RotateLeft[a]; a[[ -1]]=s; If[PrimeQ[s], AppendTo[lst, n]], {n, 30000}]; lst

Formula

a(n) = A249635(n) - 4. A105759(n) = A001592(A249635(n)) = A001592(a(n) + 4). - M. F. Hasler, Apr 22 2018

Extensions

a(10)-a(12) from Robert Price, Nov 02 2014
Edited by M. F. Hasler, Apr 22 2018

A302990 a(n) = index of first odd prime number in the (n-th)-order Fibonacci sequence Fn, or 0 if no such index exists.

Original entry on oeis.org

0, 0, 4, 6, 9, 10, 40, 14, 17, 19, 361, 23, 90, 26, 373, 47, 288, 34, 75, 38, 251, 43, 67, 47, 74, 310, 511, 151534, 57, 20608, 1146, 62, 197, 94246, 9974, 287, 271172, 758
Offset: 0

Views

Author

Jacques Tramu, Apr 17 2018

Keywords

Comments

Fn is defined by: Fn(0) = Fn(1) = ... = Fn(n-2) = 0, Fn(n-1) = 1, and Fn(k+1) = Fn(k) + Fn(k-1) + ... + Fn(k-n+1).
In general, Fn(k) is odd iff k == -1 or -2 (mod n+1), therefore a(n) = k*(n+1) - (1 or 2) for all n. Since Fn(n-1) = F(n) = 1, we must have a(n) >= 2n. Since Fn(k) = 2^(k-n) for n <= k < 2n, Fn(2n) = 2^n-1, so a(n) = 2n exactly for the Mersenne prime exponents A000043, while a(n) = 2n+1 when n is not in A000043 but n+1 is in A050414. - M. F. Hasler, Apr 18 2018
Further terms of the sequence: a(38) > 62000, a(39) > 72000, a(40) = 285, a(41) > 178000, a(42) = 558, a(44) = 19529, a(46) = 33369, a(47) = 239, a(48) = 6368, a(53) = 2860, a(54) = 2418, a(58) = 176, a(59) = 18418, a(60) = 1463, a(61) = 122, a(62) = 8755, a(63) = 5118, a(64) = 25089, a(65) = 988, a(66) = 333, a(67) = 406, a(70) = 1632, a(74) = 374, a(76) = 13704, a(77) = 4991, a(86) = 347, a(89) = 178, a(92) = 1114, a(93) = 187, a(98) = 395, a(100) > 80000; a(n) > 10^4 for all other n up to 100. - Jacques Tramu and M. F. Hasler, Apr 18 2018

Examples

			a(2) = 4 because F2 (Fibonacci) = 0, 1, 1, 2, 3, 5, 8, ... and F2(4) = 3 is prime.
a(3) = 6 because F3 (tribonacci) = 0, 0, 1, 1, 2, 4, 7, 13, ... and F3(6) = 7 is prime.
a(4) = 9 because F4 (tetranacci) = 0, 0, 0, 1, 1, 2, 4, 8, 15, 29, 56, ...  and F4(9) = 29 is prime.
From _M. F. Hasler_, Apr 18 2018: (Start)
We see that Fn(k) = 2^(k-n) for n <= k < 2n and thus Fn(2n) = 2^n-1, so a(n) = 2n exactly for the Mersenne prime exponents A000043.
a(n) = 2n + 1 when 2^(n+1) - 3 is prime (n+1 in A050414) but 2^n-1 is not, i.e., n = 4, 8, 9, 11, 21, 23, 28, 93, 115, 121, 149, 173, 212, 220, 232, 265, 335, 451, 544, 688, 693, 849, 1735, ...
For other primes we have: a(29) = 687*30 - 2, a(37) = 20*38 - 2, a(41) > 10^4, a(43) > 10^4, a(47) = 5*48 - 1, a(53) = 53*54 - 2, a(59) = 307*60 - 2, a(67) = 6*67 - 1. (End)
		

Crossrefs

Cf. A000045 (F2), A000073 (F3), A000078 (F4), A001591 (F5), A001592 (F6), A122189(F7), A079262 (F8), A104144 (F9), A122265 (F10).
(According to the definition, F0 = A000004 and F1 = A000012.)
Cf. A001605 (indices of prime numbers in F2).

Programs

  • PARI
    A302990(n,L=oo,a=vector(n+1,i,if(i1 && for(i=-2+2*n+=1,L, ispseudoprime(a[i%n+1]=2*a[(i-1)%n+1]-a[i%n+1]) && return(i))} \\ Testing primality only for i%n>n-3 is not faster, even for large n. - M. F. Hasler, Apr 17 2018; improved Apr 18 2018

Formula

a(n) == -1 or -2 (mod n+1). a(n) >= 2n, with equality iff n is in A000043. a(n) <= 2n+1 for n+1 in A050414. - M. F. Hasler, Apr 18 2018

Extensions

a(29) from Jacques Tramu, Apr 19 2018
a(33) from Daniel Suteu, Apr 20 2018
a(36) from Jacques Tramu, Apr 25 2018

A258800 The number of zeroless decimal numbers whose digital sum is n.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1021, 2040, 4076, 8144, 16272, 32512, 64960, 129792, 259328, 518145, 1035269, 2068498, 4132920, 8257696, 16499120, 32965728, 65866496, 131603200, 262947072, 525375999, 1049716729, 2097364960, 4190597000, 8372936304, 16729373488, 33425781248
Offset: 0

Views

Author

Robert G. Wilson v, Jun 10 2015

Keywords

Comments

If you were to include decimal numbers that contain any number of zeros, then a(n) would be infinity. If on the other hand, you limit the number of zeros to some number, then a(n) is finite.

Examples

			a(0) = 0 since there exists no decimal number lacking a zero whose digital sum is zero.
a(1) = 1 since there exists only one zeroless decimal number whose digital sum is one and that number is 1.
a(2) = 2 since there exist only two zeroless decimal numbers whose digital sum is two and they are 2 & 11.
a(3) = 4 since there exist only four zeroless decimal numbers whose digital sum is three and they are 3, 21, 12 & 111.
a(4) = 8 since there exist only eight zeroless decimal numbers whose digital sum is four and they are 4, 31, 13, 22, 211, 121, 112 & 1111.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[ Series[-1 + 1/(1 - x (1 + x + x^2) (1 + x^3 + x^6)), {x, 0, 36}], x]

Formula

a(n) = A104144(n+8) for n>0.
G.f.: -(x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9)/(-1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9) = -1 + 1/(1-x(1 + x + x^2)(1 + x^3 + x^6)).

A104418 Number of prime factors, with multiplicity, of the nonzero 9-acci numbers.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 6, 3, 5, 7, 9, 9, 11, 9, 3, 2, 2, 8, 7, 7, 7, 10, 11, 10, 3, 2, 7, 8, 11, 7, 12, 13, 15, 11, 3, 2, 6, 7, 7, 10, 9, 12, 12, 13, 5, 2, 5, 8, 8, 7, 13, 12, 10, 12, 6, 3, 3, 6, 12, 11, 12, 10, 12, 12, 2, 6, 12, 8, 11, 9, 14, 13, 13, 13, 7, 2
Offset: 1

Views

Author

Jonathan Vos Post, Mar 06 2005

Keywords

Comments

Prime 9-acci numbers: b(3) = 2, b(12) = 1021, ... Semiprime 9-acci numbers: b(4) = 4 = 2^2, b(11) = 511 = 7 * 73, b(22) = 1035269 = 47 * 22027, b(23) = 2068498 = 2 * 1034249, b(32) = 1049716729 = 1051 * 998779 b(42) = 1064366053385 = 5 * 212873210677, b(52) = 1079219816432629 = 28669 * 37644138841, b(71) = 555323195719171835391 = 3 * 185107731906390611797, b(82) = 1125036467745713090813969 = 37 * 30406391020154407859837.

Examples

			a(1)=a(2)=0 because the first two nonzero 9-acci numbers are both 1, which has zero prime divisors.
a(3)=1 because the 3rd nonzero 9-acci number is 2, a prime, with only one prime divisor.
a(4)=2 because the 4th nonzero 9-acci number is 4 = 2^2 which has (with multiplicity) 2 prime divisors (which happen to be equal).
a(5)=3 because the 5th nonzero 9-acci number is 8 = 2^3.
a(13) = 6 because b(13) = 2040 = 2^3 * 3 * 5 * 17 so has 6 prime factors (2 with multiplicity 3 and 3, 5 and 17 once each).
		

Crossrefs

Formula

a(n) = A001222(A104144(n+7)).
Previous Showing 11-18 of 18 results.