OFFSET
1,2
COMMENTS
First differences are Pi's shadow. Never twice the same integer in sequence or first differences.
a(20) is 1848, not 993, since the latter would leave out the next 0 in Pi. - Michael S. Branicky, Jun 15 2021
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
The first line hereunder is the sequence, the second line are the first differences:
1.4..18..33.42.44.50.55..90.98..195..288..311...
.3.14..15..9..2..6..5..35..8..97...93...23 <-- Pi shadow
(Pi=3.141592653589793238462643383279502884197169399...)
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Block[{c = RealDigits[Pi, 10, 300][[1]], k = 1, t = Table[a[i], {i, n - 1}]}, d = Drop[t, 1] - Drop[t, -1]; b = Drop[c, Length[ Flatten[ IntegerDigits /@ d]]]; e = Union[ Join[t, d]]; While[f = FromDigits[ Take[b, k]]; Position[e, f] != {} || b[[k + 1]] == 0, k++ ]; f + a[n - 1]]; Table[ a[n], {n, 47}] (* Robert G. Wilson v *)
PROG
(Python)
# download https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt, then
# with open('pi-billion.txt', 'r') as f: pi = f.readline()
from sympy import S
pi = str(S.Pi.n(3*10**5)).replace('.', '') # alternatively
def aupton(terms):
global pi
alst, idx, seen = [1], 0, {0, 1}
while len(alst) < terms:
k = 1
while int(pi[idx:idx+k]) in seen or pi[idx+k] == '0': k += 1
diffn = int(digits_of_pi[idx:idx+k])
alst.append(alst[-1] + diffn)
seen |= {diffn, alst[-1]}
idx += k
return alst
print(aupton(47)) # Michael S. Branicky, Jun 15 2021
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Eric Angelini and Alexandre Wajnberg, Sep 14 2005
EXTENSIONS
More terms from Robert G. Wilson v, Oct 10 2005
STATUS
approved