OFFSET
1,2
REFERENCES
D. R. Hofstadter, Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought, (together with the Fluid Analogies Research Group), NY: Basic Books, 1995. p. 15.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
D. R. Hofstadter, Analogies and Sequences: Intertwined Patterns of Integers and Patterns of Thought Processes, DIMACS Conference on Challenges of Identifying Integer Sequences, Rutgers University, October 10 2014; Part 1, Part 2.
Eric Weisstein's World of Mathematics, Square Triangular Number
FORMULA
MAPLE
a := proc(n) floor(sqrt(n)): floor(sqrt(n+n)):
`if`(n+n = %*% + % or n = %% * %%, n, NULL) end: # Peter Luschny, May 01 2014
MATHEMATICA
With[{upto=700}, Module[{maxs=Floor[Sqrt[upto]], maxt=Floor[(Sqrt[8upto+1]- 1)/2]}, Union[Join[Range[maxs]^2, Table[(n(n+1))/2, {n, maxt}]]]]] (* Harvey P. Dale, Sep 17 2011 *)
PROG
(Haskell)
import Data.List.Ordered (union)
a005214 n = a005214_list !! (n-1)
a005214_list = tail $ union a000290_list a000217_list
-- Reinhard Zumkeller, Feb 15 2015, Aug 03 2011
(PARI) upTo(lim)=vecsort(concat(vector(sqrtint(lim\1), n, n^2), vector(floor(sqrt(2+2*lim)-1/2), n, n*(n+1)/2)), , 8) \\ Charles R Greathouse IV, Aug 04 2011
(PARI) isok(m) = ispolygonal(m, 3) || ispolygonal(m, 4); \\ Michel Marcus, Mar 13 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Russ Cox, Jun 14 1998
STATUS
approved