%I #14 Jan 09 2025 20:40:34
%S 1,51,477,651,925,2625,5551,6501,9801,17767,20475,25285,26467,29751,
%T 39285,45327,67947,75825,84135,84847,95887,99717,102051,114955,135751,
%U 151527,154401,178365,245835,261877,272001,275847,287547,292825,307587
%N Numbers which are both lucky and pentagonal.
%C Second row of array T(k,n) = n-th Lucky number which is also a (k+3)-gonal number, for nonnegative k, whose zeroth and first rows are: A118565 Numbers which are both lucky and triangular. A031162 Numbers that are both lucky and square.
%H Donovan Johnson, <a href="/A128511/b128511.txt">Table of n, a(n) for n = 1..1244</a> (terms < 10^9)
%F A000959 INTERSECTION A000326 = A000959 INTERSECTION {n*(3*n-1)/2}.
%e a(2) = 51 = A000959(14) = A000326(6).
%e a(3) = 477 = A000959(81) = A000326(18).
%p isA000326 := proc(n) local di ; if issqr(1+24*n) or n =0 then di := 1+sqrt(1+24*n); if di mod 6 = 0 or n = 0 then true ; else false ; fi ; else false ; fi; end: lin := fscanf("b000959.txt","%d %d") : while lin <> [] do a := op(2,lin) ; if isA000326( a ) then printf("%d, ",a) ; fi ; lin := fscanf("b000959.txt","%d %d") ; od : # _R. J. Mathar_, May 13 2007
%t lim=320000;lp=Ceiling[Sqrt[2lim/3]];lL=lim/2;p=Array[# (3 # - 1)/2 &, lp, 0] ;L = Table[2*i + 1, {i, 0, lL}]; For[n = 2, n < Length[L], r = L[[n++]]; L = ReplacePart[L, Table[r*i -> Nothing, {i, 1, Length[L]/r}]]];Select[Range[lim],MemberQ[p,#]&&MemberQ[L,#]&] (* _James C. McMahon_, Jan 09 2025 *)
%Y Cf. A000326, A000959, A031162, A118565.
%K easy,nonn
%O 1,2
%A _Jonathan Vos Post_, May 07 2007
%E More terms from _R. J. Mathar_, May 13 2007