cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A168341 The lexicographically earliest injective sequence of nonnegative integers such that a(a(n)) is a square for all n>=0.

This page as a plain text file.
%I A168341 #5 Jul 12 2015 20:38:47
%S A168341 0,1,3,4,9,6,16,8,25,36,11,49,13,64,15,81,100,18,121,20,144,22,169,24,
%T A168341 196,225,27,256,29,289,31,324,33,361,35,400,441,38,484,40,529,42,576,
%U A168341 44,625,46,676,48,729,784,51,841,53,900,55,961,57,1024,59,1089,61,1156,63
%N A168341 The lexicographically earliest injective sequence of nonnegative integers such that a(a(n)) is a square for all n>=0.
%C A168341 The term a(n) is either n+1 or a square. All the squares appear and they appear in increasing order. Every other term is a square, except when the index is a square, in which case, the corresponding term is also a square (which shifts the pattern). See FORMULA for a more precise statement.
%F A168341 To define a(n), let k = floor(sqrt(n)). Then a(n) = n+1 if n-k^2 is odd and ((n+k)/2)^2 if n-k^2 is even.
%F A168341 Note that k^2 is the largest square which is at most n.
%e A168341 For n=6, we have k=floor(sqrt(6))=2; since 6-2=4 is even, a(6)=((6+2)/2)^2=16.
%K A168341 nonn
%O A168341 0,3
%A A168341 _Eric Angelini_ and _Benoit Jubin_, Nov 23 2009