OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MATHEMATICA
ds[x_, b_] := Mod[ -1+b^(x-1), x] a[n_] := Block[{m=1, s=ds[m, n]}, While[(s !=0||PrimeQ[m])||Equal[m, 1] ||!Greater[m, n]||EvenQ[m], m++ ]; m]; t=Table[a[n], {n, 1, 256}]
PROG
(PARI) a(n)=my(k=n+if(n%2, 2, 1)); while(Mod(n, k)^(k-1)!=1 || isprime(k), k+=2); k \\ Charles R Greathouse IV, Apr 12 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 25 2003
STATUS
approved