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.

A004771 a(n) = 8*n + 7. Or, numbers whose binary expansion ends in 111.

This page as a plain text file.
%I A004771 #115 Jul 22 2025 15:50:22
%S A004771 7,15,23,31,39,47,55,63,71,79,87,95,103,111,119,127,135,143,151,159,
%T A004771 167,175,183,191,199,207,215,223,231,239,247,255,263,271,279,287,295,
%U A004771 303,311,319,327,335,343,351,359,367,375,383,391,399,407,415,423,431
%N A004771 a(n) = 8*n + 7. Or, numbers whose binary expansion ends in 111.
%C A004771 These numbers cannot be expressed as the sum of 3 squares. - _Artur Jasinski_, Nov 22 2006
%C A004771 These numbers cannot be perfect squares. - _Cino Hilliard_, Sep 03 2006
%C A004771 a(n-2), n >= 2, appears in the second column of triangle A239126 related to the Collatz problem. - _Wolfdieter Lang_, Mar 14 2014
%C A004771 The initial terms 7, 15, 23, 31 are the generating set for the rest of the sequence in the sense that, by Lagrange's Four Square Theorem, any number n of the form 8*k+7 can always be written as a sum of no fewer than four squares, and if n = a^2 + b^2 + c^2 + d^2, then (a mod 4)^2 + (b mod 4)^2 + (c mod 4)^2 + (d mod 4)^2 must be one of 7, 15, 23, 31. - _Walter Kehowski_, Jul 07 2014
%C A004771 Define a set of consecutive positive odd numbers {1, 3, 5, ..., 12*n + 9} and skip the number 6*n + 5. Then the contraharmonic mean of that set gives this sequence. For example, ContraharmonicMean[{1, 3, 7, 9}] = 7. - _Hilko Koning_, Aug 27 2018
%C A004771 Jacobi symbol (2, a(n)) = Kronecker symbol (a(n), 2) = 1. - _Jianing Song_, Aug 28 2018
%D A004771 James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 246.
%H A004771 Vincenzo Librandi, <a href="/A004771/b004771.txt">Table of n, a(n) for n = 0..5000</a>
%H A004771 Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a>
%H A004771 Leo Tavares, <a href="/A004771/a004771_1.jpg">Illustration: Twin Square Frames</a>
%H A004771 Leo Tavares, <a href="/A004771/a004771_2.jpg">Illustration: Mid-line Hexagons</a>
%H A004771 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=962">Encyclopedia of Combinatorial Structures 962</a>
%H A004771 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1).
%F A004771 O.g.f: (7 + x)/(1 - x)^2 = 8/(1 - x)^2 - 1/(1 - x). - _R. J. Mathar_, Nov 30 2007
%F A004771 a(n) = 2*a(n-1) - a(n-2) for n >= 2.  - _Vincenzo Librandi_, May 28 2011
%F A004771 A056753(a(n)) = 7. - _Reinhard Zumkeller_, Aug 23 2009
%F A004771 a(n) = t(t(t(n))), where t(i) = 2*i + 1.
%F A004771 a(n) = A004767(2*n+1), for n >= 0. See also A004767(2*n) = A017101(n). - _Wolfdieter Lang_, Feb 03 2022
%F A004771 From _Elmo R. Oliveira_, Apr 11 2024: (Start)
%F A004771 E.g.f.: exp(x)*(7 + 8*x).
%F A004771 a(n) = A033954(n+1) - A033954(n). (End)
%p A004771 A004771:=n->8*n+7; seq(A004771(n), n=0..100); # _Wesley Ivan Hurt_, Dec 22 2013
%t A004771 8 Range[0, 60] + 7 (* or *) Range[7, 500, 8] (* or *) Table[8 n + 7, {n, 0, 60}] (* _Bruno Berselli_, Dec 28 2016 *)
%o A004771 (Magma) [8*n+7: n in [0..60]]; // _Vincenzo Librandi_, May 28 2011
%o A004771 (PARI) a(n)=8*n+7 \\ _Charles R Greathouse IV_, Sep 23 2012
%o A004771 (Haskell)
%o A004771 a004771 = (+ 7) . (* 8)
%o A004771 a004771_list = [7, 15 ..]  -- _Reinhard Zumkeller_, Jan 29 2013
%o A004771 (GAP) List([0..60],n->8*n+7); # _Muniru A Asiru_, Aug 28 2018
%Y A004771 Cf. A004767, A008590, A017077, A017101, A017137, A033954.
%Y A004771 Cf. A007522 (primes), subsequence of A047522.
%Y A004771 Cf. A056753, A227144, A227146, A239126.
%K A004771 nonn,easy
%O A004771 0,1
%A A004771 _N. J. A. Sloane_