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.

Showing 1-5 of 5 results.

A338925 Every nonprime term k of the sequence is the cumulative sum of the nonprime digits used so far (the digits of k are included in the sum).

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 25, 37, 41, 30, 34, 43, 42, 47, 53, 59, 55, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 130, 131, 133, 137, 135, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 15 2020

Keywords

Comments

This is the lexicographically earliest sequence of distinct nonnegative terms with this property. The nonprime digits are 0, 1, 4, 6, 8 and 9.

Examples

			a(1) = 0 as 0 (a nonprime term) is the sum of all nonprime digits used so far;
a(2) = 1 as 1 (a nonprime term) is the sum of all nonprime digits used so far (0 + 1);
a(3) = 2 as 2 (a prime term) is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
...
a(14) = 25 (a nonprime term) as 25 is the sum of all nonprime digits used so far (0 + 1 + 1 + 1 + 1 + 1 + 1 + 9 + 9 + 1);
a(15) = 37 (a prime term) as 37 is the smallest term not yet present in the sequence that doesn't lead to a contradiction; etc.
		

Crossrefs

Cf. A338922, A338923 and A338924 (variants on the same idea).

Programs

  • PARI
    v=[0];w=[0];n=1;p=1;while(n<75,for(q=vecsum(w),nextprime(p+1),if(!isprime(q),m=[];for(k=1,#digits(q),if(!isprime(digits(q)[k]),m=concat(m,digits(q)[k])));c=0;if(vecsum(w)+vecsum(m)==q&&!vecsearch(vecsort(v),q),v=concat(v,q);w=concat(w,m);c++;break)));if(c==0,p=nextprime(p+1);for(j=1,#digits(p),if(!isprime(digits(p)[j]),w=concat(w,digits(p)[j])));v=concat(v,p));n++);v \\ Derek Orr, Nov 16 2020

A338922 Every odd term k of the sequence is the cumulative sum of the odd digits used so far (the digits of k are included in the sum).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 11, 32, 34, 36, 21, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 71, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 15 2020

Keywords

Comments

This is the lexicographically earliest sequence of distinct positive terms with this property.

Examples

			a(1) = 1 as the sum of all odd digits used so far is 1:
a(2) = 2 as 2 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
a(3) = 4 as a(3) = 3 would be a contradiction and a(3) = 4 doesn't lead to a contradiction;
...
a(17) = 11 as the sum of all odd digits used so far is 11 (1 + 1 + 1 + 1 + 1 + 1 + 3 + 1 + 1); etc.
		

Crossrefs

Cf. A338923, A338924 and A338925 (variants on the same idea).

Programs

  • PARI
    my(v=[], S=0,p=2, n=1);while(n<100, c=0;for(q=S, p, if(q%2, m=0;for(i=1,#digits(q),if(digits(q)[i]%2,m+=digits(q)[i]));if(S+m==q&&!vecsearch(vecsort(v), q),v=concat(v, q);  S+=m; c++; break))); if(c==0, for(j=1,#digits(p),if(digits(p)[j]%2,S+=digits(p)[j])); v=concat(v, p); p+=2); n++); v \\ Derek Orr, Nov 22 2020

A338923 Every even term k of the sequence is the cumulative sum of the even digits used so far (the digits of k are included in the sum).

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 10, 12, 29, 31, 33, 35, 37, 39, 41, 20, 43, 45, 47, 49, 40, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 70, 71, 72, 73, 75, 77, 79, 80, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 130
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 15 2020

Keywords

Comments

This is the lexicographically earliest sequence of distinct nonnegative terms with this property.

Examples

			a(1) = 0 as 0 is the sum of all even digits used so far:
a(2) = 1 as 1 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
a(3) = 2 as 2 is the sum of all even digits used so far (0 + 2);
a(4) = 3 as 3 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
...
a(17) = 10 as 10 is the sum of all even digits used so far (0 + 2 + 2 + 2 + 2 + 2 + 0);
a(18) = 12 as 12 is the sum of all even digits used so far (0 + 2 + 2 + 2 + 2 + 2 + 0 + 2);
a(19) = 29 as 29 is the smallest term not yet present in the sequence that doesn't lead to a contradiction; etc.
		

Crossrefs

Cf. A338922, A338924 and A338925 (variants on the same idea).

Programs

  • PARI
    my(v=[], S=0,p=1, n=1);while(n<100, c=0;for(q=S, p, if(!(q%2), m=0;for(i=1,#digits(q),if(!(digits(q)[i]%2),m+=digits(q)[i]));if(S+m==q&&!vecsearch(vecsort(v), q),v=concat(v, q);  S+=m; c++; break))); if(c==0, for(j=1,#digits(p),if(!(digits(p)[j]%2),S+=digits(p)[j])); v=concat(v, p); p+=2); n++); v \\ Derek Orr, Nov 22 2020

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

Views

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
    				

A340064 Every odd term k of the sequence is the cumulative sum of the prime digits used so far (the digits of k are included in the sum).

Original entry on oeis.org

3, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 9, 22, 24, 26, 28, 19, 21, 30, 32, 34, 36, 38, 40, 42, 43, 44, 46, 48, 50, 52, 54, 63, 73, 56, 58, 60, 62, 64, 66, 68, 70, 72, 101, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 131, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 141, 126, 128, 153
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Dec 28 2020

Keywords

Comments

This is the lexicographically earliest sequence of distinct positive terms with this property. The prime digits are 2, 3, 5 and 7.
The sequence is first extended with the smallest odd term not leading to a contradiction; if no such term exists, the sequence is extended with the smallest even term not yet present.

Examples

			Not a(1) = 1 as this 1, being odd, should be the sum of the prime digits so far -- which is wrong (there are none);
not a(1) = 2 as a(1) = 3 is odd and possible here;
a(12) = 9 as 9 is odd and the sum of the prime digits 3 + 2 + 2 + 2;
a(13) = 22 as 22 is the smallest even term available;
a(17) = 19 as 19 = 3 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
a(18) = 21 as 21 is the sum of 19 + 2 (the first digit of 21 itself); etc.
		

Crossrefs

Programs

  • Python
    def pds(k): return sum(int(d) for d in str(k) if d in "2357")
    def aupto(nn):
      aset, alst, primesum, nexteven = set(), [], 0, 2
      for n in range(1, nn):
        k = 1
        found = False
        while not found:
          while k in aset: k += 2
          if k == primesum + pds(k): found = True; break
          if k > primesum + 7 * len(str(k)): break
          k += 2
        if found: ak = k
        else: ak = nexteven; nexteven += 2
        aset.add(ak); alst.append(ak); primesum += pds(ak)
      return alst
    print(aupto(76)) # Michael S. Branicky, Dec 29 2020
Showing 1-5 of 5 results.