login
A174254
p-x^x where p is prime number and x is largest integer such that x^x is smaller than p.
1
1, 2, 1, 3, 7, 9, 13, 15, 19, 2, 4, 10, 14, 16, 20, 26, 32, 34, 40, 44, 46, 52, 56, 62, 70, 74, 76, 80, 82, 86, 100, 104, 110, 112, 122, 124, 130, 136, 140, 146, 152, 154, 164, 166, 170, 172, 184, 196, 200, 202, 206, 212, 214, 224, 1, 7, 13, 15, 21, 25, 27, 37, 51, 55, 57
OFFSET
1,2
COMMENTS
1^1=1;2-1=1,3-1=2, 2^2=4;5-4=1,7-4=3,11-4=7,13-4=9,...3^3=27;29-27=2,31-27=4,..
MATHEMATICA
f[n_]:=Module[{k=1}, While[n>k^k, ++k]; k-1]; Table[p=Prime[n]; a=f[p]; Prime[n]-a^a, {n, 6!}]
xn[n_]:=Module[{x=Floor[Log[n]/ProductLog[Log[n]]]}, n-x^x]; xn/@Prime[ Range[ 70]] (* Harvey P. Dale, Oct 15 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved