login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A006338 An "eta-sequence": floor((n+1)*sqrt(2) + 1/2) - floor(n*sqrt(2) + 1/2).
(Formerly M0087)
5
2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Equals its own "second derivative" (cf. A006337).
Presumably this is the same as the following sequence from Hofstadter's book: the number of triangular numbers between each successive pair of squares. More precisely, a(n) is the number of triangular numbers T such that n^2 <= T < (n+1)^2. E.g., a(3) = 2 because 3^2 <= T < 4^2 permits T(4) = 10 and T(5) = 15 and no other triangular number. - Hugo van der Sanden, May 03 2005.
a(n) = A214848(n) = A022846(n+1) - A022846(n). - Reinhard Zumkeller, Mar 03 2014
REFERENCES
Douglas Hofstadter, "Fluid Concepts and Creative Analogies", Chapter 1: "To seek whence cometh a sequence".
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
D. R. Hofstadter, Eta-Lore [Cached copy, with permission]
D. R. Hofstadter, Pi-Mu Sequences [Cached copy, with permission]
D. R. Hofstadter and N. J. A. Sloane, Correspondence, 1977 and 1991
FORMULA
a(n) = floor((n+1)*sqrt(2) + 1/2) - floor(n*sqrt(2) + 1/2). - G. C. Greubel, Nov 18 2017
MATHEMATICA
a[n_] := Floor[(n+1)*Sqrt[2]+1/2] - Floor[n*Sqrt[2]+1/2]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Nov 24 2015 *)
Differences[Table[Floor[n Sqrt[2]+1/2], {n, 120}]] (* Harvey P. Dale, Dec 10 2021 *)
PROG
(Haskell)
a006338 n = a006338_list !! (n-1)
a006338_list = tail a214848_list
-- Reinhard Zumkeller, Mar 03 2014
(PARI) for(n=1, 30, print1(floor((n+1)*sqrt(2) + 1/2) - floor(n*sqrt(2) + 1/2), ", ")) \\ G. C. Greubel, Nov 18 2017
(Magma) [Floor((n+1)*Sqrt(2)+1/2) - Floor(n*Sqrt(2)+1/2): n in [1..30]]; // G. C. Greubel, Nov 18 2017
CROSSREFS
Sequence in context: A214856 A006337 A214848 * A020903 A133083 A083921
KEYWORD
nonn,easy,nice
AUTHOR
D. R. Hofstadter, Jul 15 1977
EXTENSIONS
More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Mar 28 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 02:29 EDT 2024. Contains 372317 sequences. (Running on oeis4.)