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: Derek Orr

Derek Orr's wiki page.

Derek Orr has authored 592 sequences. Here are the ten most recent ones:

A339928 Numbers k such that the removal of all terminating even digits from k! leaves a prime.

Original entry on oeis.org

6, 7, 9, 10, 43, 138, 1068
Offset: 1

Author

Derek Orr, Dec 23 2020

Keywords

Comments

a(8) > 1500.
If only the terminating zeros are removed, 2 is the only number whose factorial becomes prime.
If one also removes 5s at the end, 7 is no longer in the sequence and no numbers below 1500 are added to the sequence.
a(8) > 20000. - Michael S. Branicky, Jul 05 2024

Examples

			43! = 60415263063373835637355132068513997507264512000000000. After removing all even digits at the end, we are left with 6041526306337383563735513206851399750726451, which is prime. So 43 is a term of this sequence.
27! = 10888869450418352160768000000. After removing all even digits at the end, we are left with 108888694504183521607, which is not prime. So 27 is not a term of this sequence.
		

Crossrefs

Cf. A000142.

Programs

  • PARI
    for(n=1,1500,k=n!;while(!(k%2),k\=10;if(k==0,break));if(isprime(k),print1(n,", ")))
    
  • Python
    from sympy import factorial, isprime
    def ok(n):
        fn = factorial(n)
        while fn > 0 and fn%2 == 0: fn //= 10
        return fn > 0 and isprime(fn)
    print(list(filter(ok, range(200)))) # Michael S. Branicky, Jun 07 2021

A338941 a(1)=1. For n >= 2, let S be the sum of all prime digits in a(1), a(2), ... a(n-1) and let C be the next nonprime number not already in the sequence. If S is a prime less than C and is not already a term of the sequence, a(n) = S. Otherwise, a(n) = C.

Original entry on oeis.org

1, 4, 6, 8, 9, 10, 12, 2, 14, 15, 16, 18, 20, 11, 21, 13, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 90
Offset: 1

Author

Eric Angelini and Derek Orr, Nov 17 2020

Keywords

Comments

Similar to A338924, however this sequence does not account for the prime digits of a(n) itself.
Each prime term is the sum of all prime digits of each previous term.

Examples

			a(16) = 13 because the sum of the prime digits from the previous terms is 2+2+5+2+2 = 13 (a prime) and 13 is less than the next nonprime (22).
a(17) = 22 because the sum of the prime digits from the previous terms is 2+2+5+2+2+3 = 16 (a nonprime), so a(17) is the next nonprime in the sequence.
a(18) = 24 because the sum of the prime digits from the previous terms is 2+2+5+2+2+3+2+2 = 20 (a nonprime).
a(16) = 25 because the sum of the prime digits from the previous terms is 2+2+5+2+2+3+2+2+2 = 22 (a nonprime).
a(17) = 26 because the sum of the prime digits from the previous terms is 2+2+5+2+2+3+2+2+2+2+5 = 29 (a prime) but it is not less than the next nonprime (which is 26).
		

Crossrefs

Cf. A338924.

Programs

  • PARI
    a(n)=my(v=[1], S=0, k=1, C=4, m); while(k
    				

A338938 a(1)=0. For n >= 2, let S be the sum of all nonprime digits in a(1), a(2), ... a(n-1) and let P be the next prime not already in the sequence. If S is a nonprime number less than P and not already in the sequence, a(n) = S. Otherwise, a(n) = P.

Original entry on oeis.org

0, 2, 3, 5, 7, 11, 13, 17, 4, 8, 16, 19, 23, 29, 31, 37, 41, 43, 47, 53, 56, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257
Offset: 1

Author

Eric Angelini and Derek Orr, Nov 16 2020

Keywords

Comments

Similar to A338925, however this sequence does not include the nonprime digits of a(n) itself.
Each nonprime term is the sum of all nonprime digits of each previous term.

Examples

			a(9) = 4 since the sum of the nonprime digits of the previous terms is 1+1+1+1 =  4 and 4 is less than the next prime, 19.
a(10) = 8 since the sum of nonprime digits of the previous terms is 1+1+1+1+4 = 8 and 8 is less than the next prime, 19.
a(11) = 16 since the sum of the nonprime digits of the previous terms is 1+1+1+1+4+8 = 16 and 16 is less than the next prime, 19.
Now, the sum of the nonprime digits of the previous terms is 1+1+1+1+4+8+1+6 = 23 (a prime number). So a(12) is the next prime number in that hasn't appeared, meaning a(12) = 19.
		

Crossrefs

Cf. A338925.

Programs

  • PARI
    my(v=[0], w=[0], n=1, p=1, m, c); while(n<125, q=vecsum(w);m=[];p=nextprime(p);c=0; for(k=1,#digits(q),if(!isprime(digits(q)[k]),m=concat(m,digits(q)[k])));if(!isprime(q)&&(q
    				

A338921 a(0)=1, a(n) for n >= 1 is the number of distinct sums of two elements in [a(0), ..., a(n-1)], chosen without replacement.

Original entry on oeis.org

1, 0, 1, 2, 3, 5, 8, 12, 17, 22, 28, 35, 43, 52, 60, 69, 77, 86, 92, 103, 112, 123, 137, 151, 168, 180, 194, 204, 224, 245, 261, 280, 301, 318, 335, 352, 369, 387, 413, 433, 459, 482, 507, 528, 552, 586, 614, 638, 669, 701, 733, 761, 791, 824, 855, 885, 917, 952, 985, 1020
Offset: 0

Author

Derek Orr, Nov 15 2020

Keywords

Comments

a(n) <= A000217(n)-n for n >= 1.
Without replacement means a(i)+a(i) is not included. However, if a(i)=a(j), a(i)+a(j) still counts because they have two different indices. If you include a(i)+a(i), the sequence becomes A000012 (all ones).
If you include the distinct sums between 3 elements and more, you arrive at the sequence 1, 0, followed by A000079 (2^n).
Same rule as in A247184, but with a(0)=1.

Examples

			a(1) gives the number of distinct sums between two elements of [1]. There aren't two elements so a(1)=0.
a(2) gives the number of distinct sums between two elements of [1,0]. The only sum are 1+0, so a(2) = 1.
a(3) gives the number of distinct sums between two elements of [1,0,1]. The two sums are 1+0 and 1+1 so a(3)=2.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n=0, {},
          {s(n-1)[], seq(a(i)+a(n), i=0..n-1)})
        end:
    a:= proc(n) option remember;
          `if`(n=0, 1, nops(s(n-1)))
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Nov 16 2020
  • Mathematica
    a[0] = 1; a[1] = 0;
    a[n_Integer?Positive] := a[n] = Length[Union[Total[Subsets[Array[a, n, 0], {2}], {2}]]];
    Array[a, 61, 0] (* Jan Mangaldan, Nov 23 2020 *)
  • PARI
    my(v=[1], w=[], n=1); while(n<75, for(i=2, #v, w=concat(w,v[i-1]+v[#v])); w=vecsort(w,,8); v=concat(v, #w); n++); v

A290227 Numbers n such that A290223(n) = 11.

Original entry on oeis.org

8, 17, 26, 29, 35, 38, 47, 56, 65, 74, 83, 92, 149, 158, 167, 197
Offset: 1

Author

Derek Orr, Jul 24 2017

Keywords

Comments

This sequence is believed to be finite. If it exists, a(17) > 10^5.

Examples

			26 is in this sequence because 26 - (2+6)^2 = -38. Then -38 + (3+8)^2 = 83. Then 83 - (8+3)^2 = -38, and so on.
		

Crossrefs

Programs

  • PARI
    a(n)=k=n; c=1; v=List(); listput(v, k); while(c, if(k>=0, k-=sumdigits(k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); if(k<0, k+=sumdigits(-k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); c+=1)
    for(n=1,10^5,if(a(n)==11,print1(n,", ")))

A290226 Numbers n such that A290223(n) = 2.

Original entry on oeis.org

2, 23, 62, 77, 119, 194, 287, 398
Offset: 1

Author

Derek Orr, Jul 24 2017

Keywords

Comments

This sequence is believed to be finite. a(9) > 10^5, if it exists.

Examples

			62 is in this sequence because 62 - (6+2)^2 = -2. Then -2 + (2)^2 = 2.
		

Crossrefs

Programs

  • PARI
    a(n)=k=n; c=1; v=List(); listput(v, k); while(c, if(k>=0, k-=sumdigits(k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); if(k<0, k+=sumdigits(-k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); c+=1)
    for(n=1,10^5,if(a(n)==2,print1(n,", ")))

A290224 Numbers n such that A290223(n) = 0.

Original entry on oeis.org

1, 19, 81, 162, 181, 199, 243, 262, 324, 343, 405, 424, 486, 505, 567, 648, 685, 729, 766, 810, 847, 891, 910, 928, 972, 1053, 1072, 1134, 1153, 1215, 1234, 1296, 1315, 1377, 1458, 1495, 1539, 1576, 1620, 1657, 1701, 1720, 1738, 1782, 1801, 1819, 1863, 1944, 1981, 1999, 2025, 2044, 2106, 2125, 2187, 2206, 2268
Offset: 1

Author

Derek Orr, Jul 24 2017

Keywords

Comments

This sequence is believed to be infinite.

Examples

			181 is in this sequence because 181 - (1+8+1)^2 = 81. Then 81 - (8+1)^2 = 0.
		

Crossrefs

Programs

  • PARI
    a(n)=k=n; c=1; v=List(); listput(v, k); while(c, if(k>=0, k-=sumdigits(k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); if(k<0, k+=sumdigits(-k)^2; c+=1; if(k==2||k==3||k==0||k==6||k==9, return(k)); if(vecsearch(Vec(v), k), return(sumdigits(abs(k)))); listput(v, k)); c+=1)
    for(n=1,10^4,if(a(n)==0,print1(n,", ")))

A290223 Algorithm: s(k) = n. s(k+1) = s(k) - digitsum(s(k))^2 if s(k) >= 0 and s(k+1) = s(k)+digitsum(abs(s(k)))^2 if s(k) < 0. Below gives the end behavior for each number n.

Original entry on oeis.org

0, 2, 3, 6, 6, 6, 3, 11, 9, 9, 3, 3, 6, 6, 6, 3, 11, 9, 0, 3, 3, 6, 2, 6, 3, 11, 9, 9, 11, 3, 6, 3, 6, 3, 11, 9, 9, 11, 3, 6, 3, 6, 3, 6, 9, 9, 11, 3, 6, 3, 6, 3, 6, 9, 9, 11, 3, 6, 6, 6, 3, 2, 9, 9, 11, 3, 6, 6, 6, 3, 3, 9, 9, 11, 3, 6, 2, 6, 3, 3, 0, 9, 11, 3, 6, 6, 6, 3, 6, 9, 9, 11, 3, 6, 6, 6, 3, 6, 9, 9, 3, 3, 6, 3, 6, 3, 3, 9, 9
Offset: 1

Author

Derek Orr, Jul 24 2017

Keywords

Comments

0 means the sequence s(k) becomes the 0 sequence.
2 means the sequence s(k) becomes 2, -2, 2, -2, ...
3 means the sequence s(k) becomes 3, -6, 30, 21, 12, 3, ...
6 means the sequence s(k) becomes 6, -30, -21, -12, -3, 6, ...
9 means the sequence s(k) oscillates between two numbers, each of which have a digit sum of 9. For example, 18 -> -63 -> 18 -> -63 -> ... so a(18) = 9.
11 means the sequence s(k) oscillates between two numbers, each of which have a digit sum of 11. For example, 65 -> -56 -> 65 -> ... so a(65) = 11.
a(n) = 2 for n = 2, 23, 62, 77, 119, 194, 287, 398. The next number n such that a(n) = 2 is over 10^5. This is believed to be finite.
a(n) = 11 for n = 8, 17, 26, 29, 35, 38, 47, 56, 65, 74, 83, 92, 149, 158, 167, 197. The next number n is over 10^5. This is believed to be finite.
The subsequences when a(n)=0, 3, 6, and 9 are believed to be infinite.

Examples

			a(19) = 0 because 19 - (1+9)^2 = -81. Then -81 + (8+1)^2 = 0.
a(13) = 6 because 13 - (1+3)^2 = -3. Then -3 + (3)^2 = 6.
a(17) = 11 because 17 - (1+7)^2 = -47. Then -47 + (4+7)^2 = 74. Then 74 - (7+4)^2 = -47, and so on.
a(23) = 2 because 23 - (2+3)^2 = -2. Then -2 + (2)^2 = 2.
a(25) = 3 because 25 - (2+5)^2 = -24. Then -24 + (2+4)^2 = 12. Then 12 - (1+2)^2 = 3.
a(28) = 9 because 28 - (2+8)^2 = -72. Then -72 + (7+2)^2 = 9. Then 9-(9)^2 = -72, and so on.
		

Crossrefs

Programs

  • PARI
    a(n)=k=n;c=1;v=List();listput(v,k);while(c,if(k>=0,k-=sumdigits(k)^2;c+=1;if(k==2||k==3||k==0||k==6||k==9,return(k));if(vecsearch(Vec(v),k),return(sumdigits(abs(k))));listput(v,k));if(k<0,k+=sumdigits(-k)^2;c+=1;if(k==2||k==3||k==0||k==6||k==9,return(k));if(vecsearch(Vec(v),k),return(sumdigits(abs(k))));listput(v,k));c+=1)

A260465 a(n) is the smallest number not already in the sequence such that a(n)^3 begins with n.

Original entry on oeis.org

1, 3, 7, 16, 8, 4, 9, 2, 21, 10, 48, 5, 11, 52, 25, 55, 12, 57, 27, 59, 6, 61, 62, 29, 63, 64, 14, 66, 31, 67, 68, 32, 15, 70, 33, 154, 72, 73, 34, 74, 161, 35, 76, 164, 77, 36, 78, 169, 17, 37, 80, 174, 81, 38, 82, 178, 83, 18, 39, 182, 85, 184, 86, 40, 87, 188, 189, 19, 191, 89, 193, 90, 194, 42, 91, 197, 92, 199, 43
Offset: 1

Author

Derek Orr, Jul 26 2015

Keywords

Comments

Conjectured to be a permutation of the natural numbers.

Crossrefs

Cf. A018852.

Programs

  • PARI
    v=[]; k=1; while(#v<100, d=digits(k^3); D=digits(#v+1); if(#D<=#d, c=1; for(i=1, #D, if(D[i]!=d[i], c=0; break)); if(c&&!vecsearch(vecsort(v), k), v=concat(v, k); k=0)); k++); v

Formula

a(n) >= n^(1/3) for all n > 0. If a(n) = n^(1/3), then n is a cube. Note the converse is false: a(27) = 14.

A260463 a(n) is the smallest number not already in the sequence such that a(n)^2 begins with n.

Original entry on oeis.org

1, 5, 6, 2, 23, 8, 27, 9, 3, 10, 34, 11, 37, 12, 39, 4, 42, 43, 14, 45, 46, 15, 48, 49, 16, 51, 52, 17, 54, 55, 56, 18, 58, 59, 188, 19, 61, 62, 63, 20, 203, 65, 66, 21, 213, 68, 69, 22, 7, 71, 72, 229, 73, 74, 235, 75, 24, 241, 77, 78, 247, 25, 251, 80, 81, 257, 26, 83, 263, 84, 267, 85, 86, 273, 87, 276, 88, 28, 89
Offset: 1

Author

Derek Orr, Jul 26 2015

Keywords

Comments

Conjectured to be a permutation of the natural numbers.
Differs from A018851 at n = 25.

Crossrefs

Cf. A018851.

Programs

  • PARI
    v=[];k=1;while(#v<100,d=digits(k^2);D=digits(#v+1);if(#D<=#d,c=1;for(i=1,#D,if(D[i]!=d[i],c=0;break));if(c&&!vecsearch(vecsort(v),k),v=concat(v,k);k=0));k++);v

Formula

a(n) >= sqrt(n) for all n > 0. If a(n) = sqrt(n), then n is a square. Note the converse is false: a(25) = 16.