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.

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).

This page as a plain text file.
%I A338922 #16 Nov 23 2020 03:48:48
%S A338922 1,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,11,32,34,36,21,38,40,42,
%T A338922 44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,71,74,76,78,80,82,84,86,
%U A338922 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
%N 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).
%C A338922 This is the lexicographically earliest sequence of distinct positive terms with this property.
%H A338922 Carole Dubois, <a href="/A338922/b338922.txt">Table of n, a(n) for n = 1..5000</a>
%e A338922 a(1) = 1 as the sum of all odd digits used so far is 1:
%e A338922 a(2) = 2 as 2 is the smallest term not yet present in the sequence that doesn't lead to a contradiction;
%e A338922 a(3) = 4 as a(3) = 3 would be a contradiction and a(3) = 4 doesn't lead to a contradiction;
%e A338922 ...
%e A338922 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.
%o A338922 (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
%Y A338922 Cf. A338923, A338924 and A338925 (variants on the same idea).
%K A338922 base,nonn
%O A338922 1,2
%A A338922 _Eric Angelini_ and _Carole Dubois_, Nov 15 2020