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.

A278818 a(n) is the least k > n such that k + n is square.

This page as a plain text file.
%I A278818 #18 Dec 03 2016 13:09:14
%S A278818 1,3,7,6,5,11,10,9,17,16,15,14,13,23,22,21,20,19,31,30,29,28,27,26,25,
%T A278818 39,38,37,36,35,34,33,49,48,47,46,45,44,43,42,41,59,58,57,56,55,54,53,
%U A278818 52,51,71,70,69,68,67,66,65,64,63,62,61,83,82,81,80,79,78
%N A278818 a(n) is the least k > n such that k + n is square.
%H A278818 Peter Kagey, <a href="/A278818/b278818.txt">Table of n, a(n) for n = 0..10000</a>
%F A278818 a(n) = ceiling(sqrt(2n+1))^2 - n. - _Jon E. Schoenfield_, Nov 28 2016
%e A278818 a(1) = 3 because 1 + 3 = 4 is square, but 1 + k is not square for 1 < k < 3.
%e A278818 a(2) = 7 because 2 + 7 = 9 is square, but 2 + k is not square for 2 < k < 7.
%e A278818 a(3) = 6 because 3 + 6 = 9 is square, but 3 + k is not square for 3 < k < 6.
%p A278818 A278818:=n->ceil(sqrt(2*n+1))^2-n: seq(A278818(n), n=0..100); # _Wesley Ivan Hurt_, Dec 01 2016
%t A278818 f[n_] := Ceiling[Sqrt[2 n + 1]]^2 - n; Array[f, 70, 0] (* _Robert G. Wilson v_, Nov 28 2016 *)
%o A278818 (Ruby)
%o A278818 def a(n)
%o A278818   (n + 1..Float::INFINITY).find { |i| n + i == ((n + i)**0.5).to_i**2 }
%o A278818 end
%Y A278818 Cf. A072905.
%K A278818 nonn,easy
%O A278818 0,2
%A A278818 _Peter Kagey_, Nov 28 2016