OFFSET
1,4
LINKS
Eric Angelini, Champernowne gamified, Personal blog, December 2023.
EXAMPLE
a(1) + a(2) = 0 + 1 = 1;
a(2) + a(3) = 1 + 1 = 2;
a(3) + a(4) = 1 + 2 = 3;
a(4) + a(5) = 2 + 2 = 4;
a(5) + a(6) = 2 + 3 = 5;
a(6) + a(7) = 3 + 3 = 6;
a(7) + a(8) = 3 + 4 = 7;
a(8) + a(9) = 4 + 4 = 8;
a(9) + a(10) = 4 + 5 = 9;
a(10) + a(11) = 5 + -4 = 1;
a(11) + a(12) = -4 + 4 = 0;
a(12) + a(13) = 4 + -3 = 1;
a(13) + a(14) = -3 + 4 = 1;
a(14) + a(15) = 4 + -3 = 1;
a(15) + a(16) = -3 + 5 = 2; etc.
The rightmost column reproduces the decimal expansion of the Champernowne constant.
MATHEMATICA
s=First@RealDigits[ChampernowneNumber[], 10, n=70];
a[1]=0; a[n_]:=a[n]=s[[n-1]]-a[n-1]; Array[a, n] (* Giorgos Kalogeropoulos, Dec 11 2023 *)
PROG
(Python)
from itertools import count, islice
def chap():
for k in count(1): yield from list(map(int, str(k)))
def agen(): # generator of terms
an = 0
for c in chap():
yield an
an = c - an
print(list(islice(agen(), 80))) # Michael S. Branicky, Dec 11 2023
CROSSREFS
KEYWORD
AUTHOR
Eric Angelini Dec 11 2023
STATUS
approved