login
a(n) is the least number k such that the k-th difference between consecutive practical numbers, A179651(k), equals 2*n, or -1 if no such k exists.
2

%I #11 Aug 04 2023 10:14:26

%S 2,5,16,33,85,46,331,188,171,300,1986,962,3321,968,2316,6514,9974,

%T 3219,12162,3831,4588,20585,30099,22005,30465,33485,28874,35901,

%U 136396,48483,120127,34145,140589,233364,126080,185421,607164,279989,359002,327768,609867,354143

%N a(n) is the least number k such that the k-th difference between consecutive practical numbers, A179651(k), equals 2*n, or -1 if no such k exists.

%C All the practical number except for 1 are even. Therefore all the differences between consecutive practical numbers are either 1 or even.

%H Amiram Eldar, <a href="/A364706/b364706.txt">Table of n, a(n) for n = 1..150</a>

%F A179651(a(n)) = 2*n.

%F A005153(a(n)) = A364707(n).

%e a(1) = 2 since A179651(2) = 2 = 2*1.

%e a(2) = 5 since A179651(5) = 4 = 2*2.

%e a(3) = 16 since A179651(16) = 6 = 2*3.

%t f[p_, e_] := (p^(e + 1) - 1)/(p - 1); pracQ[n_] := (ind = Position[(fct = FactorInteger[n])[[;; , 1]]/(1 + FoldList[Times, 1, f @@@ Most @ fct]), _?(# > 1 &)]) == {};

%t seq[len_, nmax_] := Module[{s = Table[0, {len}], n = 2, prev = 2, k = 2, c = 0, i}, While[c < len && n <= nmax, n+=2; If[pracQ[n], i = (n - prev)/2; If[i <= len && s[[i]] == 0, c++; s[[i]] = k]; prev= n; k++]]; s]; seq[20, 10^6]

%Y Cf. A005153, A179651, A330870, A364707.

%K nonn

%O 1,1

%A _Amiram Eldar_, Aug 04 2023