OFFSET
1,1
EXAMPLE
For n = 4 the number 687 is the least i > 1 such that s_2 (i) = s_3 (i) = s_5 (i) = s_6 (i), where s_k (i) is the sum of the digits in the base-k representation of i.
PROG
(PARI) tsqf(n) = {sqfs = vector(n); ipos = 1; na = 2; while (ipos <= n, if (issquarefree(na), sqfs[ipos] = na; ipos++; ); na++; ); return (sqfs); }
iok(i, sqfs) = {vdig = digits(i, sqfs[1]); sdig = sum(k=1, #vdig, vdig[k]); for (j=2, #sqfs, vdig = digits(i, sqfs[j]); if (sum(k=1, #vdig, vdig[k]) != sdig, return(0)); ); return (1); }
a(n) = {sqfs = tsqf(n); ok = 0; i = 2; while(! ok, if (iok(i, sqfs), ok = 1, i++); ); return (i); } \\ Michel Marcus, May 25 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, Nov 14 2012
STATUS
approved