OFFSET
1,2
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Erich Friedman, What's Special About This Number? (See entry 7056.)
MAPLE
N:= 10^6: # to get all terms <= N
A:= select(issqr, {seq(seq(a*(a+1)*b*(b+1)/4,
b = a .. floor(sqrt(1/4+4*N/a/(a+1))-1/2)), a=1..floor(sqrt(4*N)))});
# if using Maple 11 or earlier, uncomment the next line
# sort(convert(A, list)); # Robert Israel, Jan 16 2015
MATHEMATICA
M = 10^6; (* to get all terms <= M *)
A = Union[Select[Flatten[Table[Table[(1/4) a (a+1) b (b+1), {b, a, Floor[ Sqrt[1/4 + 4M/(a (a+1))] - 1/2]}], {a, 1, Floor[Sqrt[4M]]}]], IntegerQ[ Sqrt[#]]&]] (* Jean-François Alcover, Mar 09 2019, after Robert Israel *)
PROG
(PARI) istriangular(n)=issquare(8*n+1) \\ now one can use ispolygonal(n, 3)
isok(n) = {if (issquare(n), fordiv(n, d, if (d > sqrtint(n), break); if (istriangular(d) && istriangular(n/d), return (1)); ); ); return (0); } \\ Michel Marcus, Jul 24 2013
(Haskell)
a169835 n = a169835_list !! (n-1)
a169835_list = f [] (tail a000217_list) (tail a000290_list) where
f ts us'@(u:us) vs'@(v:vs)
| u <= v = f (u : ts) us vs'
| any p $ map (divMod v) ts = v : f ts us' vs
| otherwise = f ts us' vs
where p (q, r) = r == 0 && a010054 q == 1
-- Reinhard Zumkeller, Mar 03 2015
(Python)
from itertools import count, islice, takewhile
from sympy import divisors
from sympy.ntheory.primetest import is_square
def A169835_gen(): # generator of terms
return filter(lambda k:any(map(lambda d: is_square((d<<3)+1) and is_square((k//d<<3)+1), takewhile(lambda d:d**2<=k, divisors(k)))), (m**2 for m in count(0)))
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, May 30 2010
EXTENSIONS
Corrected (missing terms inserted) by R. J. Mathar, Jun 04 2010
STATUS
approved