login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A330385
Add the odd terms and subtract the even ones, the result must always be a square. This is the lexicographically earliest sequence of distinct positive integers with this property.
3
1, 3, 4, 9, 7, 12, 5, 8, 15, 16, 25, 11, 13, 24, 39, 17, 19, 21, 23, 44, 36, 28, 20, 33, 40, 27, 32, 45, 48, 35, 85, 72, 51, 64, 133, 87, 60, 29, 31, 105, 123, 84, 41, 43, 141, 96, 47, 49, 159, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 164, 156
OFFSET
1,2
COMMENTS
This sequence is a variant of A329544.
All terms belong to A042965.
EXAMPLE
The first terms, alongside the corresponding running totals, are:
n a(n) t(n)
-- ---- --------
1 1 1 = 1^2
2 3 4 = 2^2
3 4 0 = 0^2
4 9 9 = 3^2
5 7 16 = 4^2
6 12 4 = 2^2
7 5 9 = 3^2
8 8 1 = 1^2
9 15 16 = 4^2
10 16 0 = 0^2
11 25 25 = 5^2
PROG
(PARI) s=t=0; for (n=1, 65, for (v=1, oo, if (!bittest(s, v) && issquare(u=t-v*(-1)^v), print1 (v", "); s+=2^v; t=u; break)))
CROSSREFS
Cf. A000290, A042965, A329544, A330386 (running totals).
Sequence in context: A356541 A062319 A285265 * A178590 A022463 A378116
KEYWORD
nonn,look
AUTHOR
Rémy Sigrist, Dec 12 2019
STATUS
approved