login
Decimal expansion of f(0) such that f(n) = log(abs(f(n-1))) > 0 iff n is a prime number (negated).
1

%I #25 Jan 14 2021 21:17:36

%S 2,1,7,2,2,6,8,9,8,3,5,6,1,2,0,8,4,2,7,4,3,0,1,9,2,8,8,2,3,3,3,5,3,8,

%T 8,8,5,4,1,4,4,1,0,2,2,3,3,0,0,6,1,7,3,6,2,2,9,6,9,4,2,0,1,4,9,3,8,4,

%U 4,9,9,7,7,8,5,1,9,2,9,7,1,1,9,3,5,5,0,3,2,2,2,0,5,9,0,8,5,8,8,8

%N Decimal expansion of f(0) such that f(n) = log(abs(f(n-1))) > 0 iff n is a prime number (negated).

%C If f(0)=A201942, f(n) will generate the odd numbers.

%C From _Jon Maiga_, May 02 2019: (Start)

%C The image shows f(n), note the symmetry around -LambertW(1) (~ -0.57). For example, all values in the lowest positive horizontal 'segment' (f(n) ~ 0.2) consists of the lesser twin primes (A001359). The corresponding segment at f(n)~-1.2 are n such that n+1 and n+3 are primes (A144834).

%C With 256-digit precision for f(0), f(n) will correctly decode all n up to 1069, which is the 180th prime number.

%C (End)

%H J. Maiga, <a href="http://jonkagstrom.com/sne/index.html">Fun with signed nested exponentials and the prime numbers</a>

%H Jon Maiga, <a href="/A317547/a317547.png">Plot of f(n) with n up to 4000.</a>

%F Equals lim_{n->oo} sf(0)*exp(sf(1)*exp(...sf(n-1)*exp(sf(n)))) where sf(n)=2*(A010051(n)-1).

%e -0.02172268983561208427430192882333538885414410223300617362296942014938449977851...

%t f0[n_] := (v = 0; For[i = n, i >= 0, i--, v = If[PrimeQ[i], 1, -1]*Exp[v]]; v);

%t RealDigits[f0[1000], 10, 100][[1]]

%Y Cf. A010051, A201942.

%K nonn,cons

%O -1,1

%A _Jon Maiga_, Jul 30 2018