cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A356978 a(n) is the first number k such that k^i is a quasi-Niven number (A209871) for 1<=i<=n but not for i=n+1.

This page as a plain text file.
%I A356978 #11 Sep 26 2022 20:26:45
%S A356978 13,11,1145,121,31109,1510081,34110497,5343853441,17636269729
%N A356978 a(n) is the first number k such that k^i is a quasi-Niven number (A209871) for 1<=i<=n but not for i=n+1.
%C A356978 a(n) is the first number k such that the remainder on division of k^i by its sum of digits is 1 for 1<=i<=n but not i=n+1.
%e A356978 a(4) = 121 because 121, 121^2 = 14641, 121^3 = 1771561, 121^4 = 214358881, and 121^5 = 25937424601 have sums of digits 4, 16, 28, 40, and 43 respectively, and 121 mod 4 = 1, 121^2 mod 16 = 1, 121^3 mod 28 = 1, 121^4 mod 40 = 1, but 121^4 mod 43 = 41 <> 1, and 121 is the first number that works.
%p A356978 sd:= n -> convert(convert(n,base,10),`+`):
%p A356978 f:= proc(n) local d;
%p A356978   for d from 1 do
%p A356978     if n^d mod sd(n^d) <> 1 then return d-1 fi
%p A356978 od
%p A356978 end proc:
%p A356978 V:= Vector(6): count:= 0:
%p A356978 for n from 1 while count < 6 do
%p A356978   v:= f(n);
%p A356978 if v > 0 and V[v] = 0 then
%p A356978     count:= count+1; V[v]:= n
%p A356978 fi
%p A356978 od:
%p A356978 convert(V,list);
%t A356978 quasiNivenQ[n_] := (s = Plus @@ IntegerDigits[n]) > 1 && Divisible[n - 1, s]; f[k_] := Module[{i = 0, m = k}, While[quasiNivenQ[m], m *= k; i++]; i]; seq[len_, nmax_] := Module[{s = Table[0, {len}], n = 2, c = 0, i}, While[c < len && n < nmax, i = f[n]; If[0 < i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[6, 10^7] (* _Amiram Eldar_, Sep 07 2022 *)
%Y A356978 Cf. A007953, A209871.
%K A356978 nonn,base,more
%O A356978 1,1
%A A356978 _Robert Israel_, Sep 07 2022
%E A356978 a(7) from _Amiram Eldar_, Sep 07 2022
%E A356978 a(8) and a(9) from _Giorgos Kalogeropoulos_, Sep 09 2022.