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.

A158034 Integers n for which f = (4^n - 2^n + 8n^2 - 2) / (2n * (2n + 1)) is an integer.

This page as a plain text file.
%I A158034 #11 Jun 15 2025 23:16:37
%S A158034 3,11,23,83,131,179,191,239,243,251,359,419,431,443,491,659,683,719,
%T A158034 743,891,911,1019,1031,1103,1223,1439,1451,1499,1511,1539,1559,1583,
%U A158034 1811,1931,2003,2039,2063,2211,2339,2351,2399,2459,2511,2543,2699,2819,2903
%N A158034 Integers n for which f = (4^n - 2^n + 8n^2 - 2) / (2n * (2n + 1)) is an integer.
%C A158034 Superset of A002515; 2n + 1 is prime. A recursive search for members of this sequence results in the infinite series of very large primes A145918. Most members of this sequence are also prime, but five members less than 10000 are composite:
%C A158034 .. . 243 = 3^5
%C A158034 .. . 891 = 3^4 * 11
%C A158034 . . 1539 = 3^4 * 19
%C A158034 . . 2211 = 3 * 11 * 67
%C A158034 . . 2511 = 3^4 * 31
%C A158034 The polygonal number with f sides of length 2n + 1 is (2^n - 1)(2^(n - 1)).
%C A158034 Contribution from _Reikku Kulon_, May 19 2009: (Start)
%C A158034 The average difference between successive composite terms gradually increases, remaining near their order of magnitude. Roughly 3% of all primes less than 20 billion belong to this sequence or the 2n + 1 sequence. The interval between composite terms 12228632879 and 13169544651 contains 1113606 primes, accounting for 2.75% of the primes in the interval and 1.42% of the primes between 24457265759 and 26339089303.
%C A158034 Prime factors are most often congruent to 3 (mod 4), but some factors are congruent to 1 (mod 4), especially when a term has an even number of not necessarily distinct factors. The most common factor is 3, and often a large power of 3 is a divisor. 5, 7, 13, and 17 are never factors.
%C A158034 The ones digit of composite terms is most often 1, and becomes progressively more likely to be 1. It is never 5. It cannot be 7, because 2n + 1 would then be divisible by 5. The lack of solutions with n divisible by 5 appears crucial to the consistent primality of 2n + 1.
%C A158034 The tens digit is odd if the ones digit is 1 or 9; it is even if the ones digit is 3. This is a consequence of congruence to 3 (mod 4).
%C A158034 The most common least significant two digits of composite terms are 51.
%C A158034 The least significant digits of prime terms do not follow an obvious distribution.
%C A158034 This is the simplest and possibly most productive member of a family of similar sequences defined by f = (s + 8n^2 - 2) / (2n * (2n + 1)), where s is pronic. For these sequences, 2n + 1 is dominated by primes.
%C A158034 =====================================
%C A158034 Large sequences of consecutive primes
%C A158034 =====================================
%C A158034 .   Initial term    Primes   Predecessor     Successor          Gap
%C A158034 .   ---------------------------------------------------------------
%C A158034 .     1529648303    157285    1529648231    1639846391    110198160
%C A158034 .     3832649339    473045    3832647111    4193496803    360849692
%C A158034 .     5897103683    411434    5897102751    6223464171    326361420
%C A158034 .     6543227423    445293    6543226251    6899473631    356247380
%C A158034 .     8126586971    913506    8126586711    8871331491    744744780
%C A158034 .     9533381219    689395    9533380131   10103115231    569735100
%C A158034 .    11576086883    708712   11576086731   12171829419    595742688
%C A158034 .    12228633251   1113606   12228632879   13169544651    940911772
%C A158034 .    21315457451   2328623   21315457251   23375077119   2059619868
%C A158034 (End)
%H A158034 Reinhard Zumkeller, <a href="/A158034/b158034.txt">Table of n, a(n) for n = 1..1000</a>
%H A158034 Mario Raso, <a href="https://iris.uniroma1.it/handle/11573/1732819">Integer Sequences in Cryptography: A New Generalized Family and its Application</a>, Ph. D. Thesis, Sapienza University of Rome (Italy 2025). See p. 112.
%e A158034 ngon(f, k) = k * (f * (k - 1) / 2 - k + 2)
%e A158034 . . . 3 = (4^3 - 2^3 + 8 * 9 - 2) / (6 * 7)
%e A158034 . . . . = (2 * 28 + 70) / 42
%e A158034 . . 126 = (2 * 28 + 70)
%e A158034 .. . 28 = (2^3 - 1) * 2^2
%e A158034 . . . . = 126 - 70 - 28
%e A158034 . . . . = 7 * (18 - 10 - 4)
%e A158034 . . . . = 7 * (3 * 6 - 3 * 3 - 5)
%e A158034 . . . . = 7 * (3 * 3 - 7 + 2)
%e A158034 .. 8287 = (4^11 - 2^11 + 8 * 121 - 2) / (22 * 23)
%e A158034 . . . . = (2 * 2096128 + 966) / 506
%e A158034 4193222 = (2 * 2096128 + 966)
%e A158034 2096128 = (2^11 - 1) * 2^10
%e A158034 . . . . = 4193222 - 2096128 - 966
%e A158034 . . . . = 23 * (182314 - 91136 - 42)
%e A158034 . . . . = 23 * (8287 * 22 - 8287 * 11 - 21)
%e A158034 . . . . = 23 * (8287 * 11 - 23 + 2)
%e A158034 Coincidentally, 8287 = 129 * 64 + 31 = 257 * 32 + 63 is prime, and may be the largest value of f that is.
%e A158034 1031 = 257 * 4 + 3 and 2063 = 1031 * 2 + 1 are both members of this sequence, 4127 = 2063 * 2 + 1 is prime, and 8287 = (4127 + 16) * 2 + 1.
%o A158034 (Haskell)
%o A158034 a158034 n = a158034_list !! (n-1)
%o A158034 a158034_list = [x | x <- [1..],
%o A158034                     (4^x - 2^x + 8*x^2 - 2) `mod` (2*x*(2*x + 1)) == 0]
%o A158034 -- _Reinhard Zumkeller_, Jan 12 2014
%Y A158034 Cf. A002515 (Lucasian primes)
%Y A158034 Cf. A145918 (exponential Sophie Germain primes)
%Y A158034 Cf. A139601 (polygonal numbers)
%Y A158034 Cf. A046318, A139876 (related to composite members 243, 891, 1539, and 2511)
%Y A158034 Cf. A060210, A002034, A109833, A136801 (their factors)
%Y A158034 Cf. A039506 (3, 8287)
%Y A158034 Cf. A006516 (2^n - 1)(2^(n - 1))
%Y A158034 Cf. A000051 (Fermat numbers), A019434 (Fermat primes)
%Y A158034 Cf. A142291 (prime sequence 257, 1031, 2063, 4127)
%Y A158034 Cf. A235540 (nonprimes), A002943.
%K A158034 easy,nonn
%O A158034 1,1
%A A158034 _Reikku Kulon_, Mar 11 2009