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.

Previous Showing 21-30 of 44 results. Next

A243577 Integers of the form 8k+7 that can be written as a sum of four distinct 'almost consecutive' squares.

Original entry on oeis.org

39, 71, 87, 119, 191, 255, 287, 351, 471, 567, 615, 711, 879, 1007, 1071, 1199, 1415, 1575, 1655, 1815, 2079, 2271, 2367, 2559, 2871, 3095, 3207, 3431, 3791, 4047, 4175, 4431, 4839, 5127, 5271, 5559, 6015, 6335, 6495, 6815, 7319, 7671, 7847, 8199, 8751, 9135, 9327, 9711
Offset: 1

Views

Author

Walter Kehowski, Jun 08 2014

Keywords

Comments

By Lagrange's Four Square Theorem, any integer n of the form 8k+7 (A004771) can be written as sum of no fewer than four squares. The initial terms 7,15,23,31 are the generating set for A004771 in the sense that 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 is one of 7,15,23,31.
From now on assume that n is of the form 8k+7 and is a sum of distinct squares a,b,c,d, sorted.
We say that [a,b,c,d] is almost consecutive if the differences b-a, c-b, d-c are 1 or 2. The generating set for this sequence is
39, [1,2,3,5], with gap pattern 112,
71, [1,3,5,6], with gap pattern 221,
87, [2,3,5,7], with gap pattern 122,
119, [3,5,6,7], with gap pattern 211,
in the sense that adding [4*i,4*i,4*i,4*i], i >= 0, preserves the gap pattern. It should be noted that the four generators are all obtainable from [1,1,2,3] or [1,2,3,3] by addition of suitable vectors. Let's write it out:
[1,2,3,5] = [1,1,2,3] + [4,0,0,0] or
[1,2,3,5] = [1,1,2,3] + [0,4,0,0]
[1,3,5,6] = [1,1,2,3] + [0,4,4,0]
[2,3,5,7] = [1,2,3,3] + [4,0,4,0] or
[2,3,5,7] = [1,2,3,3] + [4,0,0,4]
[3,5,6,7] = [1,2,3,3] + [4,4,4,0] or
[3,5,6,7] = [1,2,3,3] + [4,4,0,4].
There are generators for other gap patterns, but the minimal gap patterns are of the most interest. - Walter Kehowski, Jul 07 2014

Examples

			For n=1, a(n) = 4*1^2 + 14*1 + 21 =  39 and  39 = 1^2 + 2^2 + 3^2 + 5^2.
For n=2, a(n) = 4*2^2 + 14*2 + 27 =  39 and  71 = 1^2 + 3^2 + 5^2 + 6^2.
For n=3, a(n) = 4*3^2 + 10*3 + 21 =  87 and  87 = 2^2 + 3^2 + 5^2 + 7^2.
For n=4, a(n) = 4*4^2 + 10*4 + 15 = 119 and 119 = 3^2 + 5^2 + 6^2 + 7^2.
		

Crossrefs

Programs

  • Maple
    A243577 := proc(n::posint)
       if n mod 4 = 1 then
          return [4*n^2+14*n+21, [n,n+1,n+2,n+4]]
       elif n mod 4 = 2 then
          return [4*n^2+14*n+27, [n-1,n+1,n+3,n+4]]
       elif n mod 4 = 3 then
          return [4*n^2+10*n+21, [n-1,n,n+2,n+4]]
       else
          return [4*n^2+10*n+15, [n-1,n+1,n+2,n+3]]
       fi;
    end:
    # Walter A. Kehowski, Jun 08 2014
  • Mathematica
    Rest@ CoefficientList[Series[-x (15 x^6 - 30 x^5 + 45 x^4 - 60 x^3 + 69 x^2 - 46 x + 39)/((x - 1)^3*(x^2 + 1)^2), {x, 0, 48}], x] (* Michael De Vlieger, Feb 19 2019 *)
    LinearRecurrence[{3,-5,7,-7,5,-3,1},{39,71,87,119,191,255,287},50] (* Harvey P. Dale, Jul 05 2021 *)
  • PARI
    Vec(-x*(15*x^6-30*x^5+45*x^4-60*x^3+69*x^2-46*x+39)/((x-1)^3*(x^2+1)^2) + O(x^100)) \\ Colin Barker, Jun 09 2014

Formula

If n mod 4 = 1, then a(n) = 4*n^2 + 14*n + 21.
If n mod 4 = 2, then a(n) = 4*n^2 + 14*n + 27.
If n mod 4 = 3, then a(n) = 4*n^2 + 10*n + 21.
If n mod 4 = 0, then a(n) = 4*n^2 + 10*n + 15.
a(n) = -3*(-7 + (-i)^n+i^n) - (1-i)*((-6-6*i) + (-i)^n + i*i^n)*n + 4*n^2 where i=sqrt(-1). - Colin Barker, Jun 09 2014
G.f.: -x*(15*x^6 - 30*x^5 + 45*x^4 - 60*x^3 + 69*x^2 - 46*x + 39) / ((x-1)^3*(x^2+1)^2). - Colin Barker, Jun 09 2014

A227144 Numbers that are congruent to {1, 2, 7, 17, 23} modulo 24.

Original entry on oeis.org

1, 2, 7, 17, 23, 25, 26, 31, 41, 47, 49, 50, 55, 65, 71, 73, 74, 79, 89, 95, 97, 98, 103, 113, 119, 121, 122, 127, 137, 143, 145, 146, 151, 161, 167, 169, 170, 175, 185, 191, 193, 194, 199, 209, 215, 217, 218, 223, 233, 239, 241, 242, 247, 257, 263, 265, 266
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2013

Keywords

Comments

A089911(a(n)) = 1.

Crossrefs

Programs

  • Haskell
    a227144 n = a227144_list !! (n-1)
    a227144_list = [1,2,7,17,23] ++ map (+ 24) a227144_list
    
  • Magma
    [n : n in [0..300] | n mod 24 in [1, 2, 7, 17, 23]]; // Wesley Ivan Hurt, Dec 26 2016
    
  • Maple
    A227144:=n->24*floor(n/5)+[1, 2, 7, 17, 23][(n mod 5)+1]: seq(A227144(n), n=0..100); # Wesley Ivan Hurt, Dec 26 2016
  • Mathematica
    Select[Range[500], MemberQ[{1, 2, 7, 17, 23}, Mod[#, 24]] &] (* Wesley Ivan Hurt, Dec 26 2016 *)
    LinearRecurrence[{1,0,0,0,1,-1},{1,2,7,17,23,25},60] (* Harvey P. Dale, Dec 18 2019 *)
  • PARI
    Vec(x*(1+x)*(x^4 +5*x^3 +5*x^2 +1)/((x^4 +x^3 +x^2 +x +1)*(x-1)^2) + O(x^50)) \\ G. C. Greubel, Dec 26 2016

Formula

G.f.: x*(1+x)*(x^4+5*x^3+5*x^2+1) / ( (x^4+x^3+x^2+x+1)*(x-1)^2 ). - R. J. Mathar, Jul 17 2013
From Wesley Ivan Hurt, Dec 26 2016: (Start)
a(n) = a(n-1) + a(n-5) - a(n-6) for n > 6.
a(n) = (120*n - 110 - 6*(n mod 5) - 26*((n+1) mod 5) - ((n+2) mod 5) + 19*((n+3) mod 5) + 14*((n+4) mod 5))/25.
a(5k) = 24k-1, a(5k-1) = 24k-7, a(5k-2) = 24k-17, a(5k-3) = 24k-22, a(5k-4) = 24k-23. (End)

A227146 Numbers that are congruent to {5, 11, 13, 14, 19} modulo 24.

Original entry on oeis.org

5, 11, 13, 14, 19, 29, 35, 37, 38, 43, 53, 59, 61, 62, 67, 77, 83, 85, 86, 91, 101, 107, 109, 110, 115, 125, 131, 133, 134, 139, 149, 155, 157, 158, 163, 173, 179, 181, 182, 187, 197, 203, 205, 206, 211, 221, 227, 229, 230, 235, 245, 251, 253, 254, 259, 269
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2013

Keywords

Comments

A089911(a(n)) = 5.

Crossrefs

Programs

  • Haskell
    a227146 n = a227146_list !! (n-1)
    a227146_list = [5,11,13,14,19] ++ map (+ 24) a227146_list
  • Mathematica
    Select[Range[300],MemberQ[{5,11,13,14,19},Mod[#,24]]&] (* or *) LinearRecurrence[{1,0,0,0,1,-1},{5,11,13,14,19,29},60] (* Harvey P. Dale, Apr 30 2018 *)

Formula

G.f.: x*(1+x)*(5*x^4+x^2+x+5) / ( (x^4+x^3+x^2+x+1)*(x-1)^2 ). - R. J. Mathar, Jul 17 2013
From Wesley Ivan Hurt, Dec 28 2016: (Start)
a(n) = a(n-1) + a(n-5) - a(n-6) for n > 6.
a(n) = (120*n - 50 - (n mod 5) + 19*((n+1) mod 5) + 14*((n+2) mod 5) - 6*((n+3) mod 5) - 26*((n+4) mod 5))/25. (End)

A297970 Numbers that are not the sum of 3 squares and a nonnegative 7th power.

Original entry on oeis.org

112, 240, 368, 496, 624, 752, 880, 1008, 1136, 1264, 1392, 1520, 1648, 1776, 1904, 2032, 2160
Offset: 1

Views

Author

XU Pingya, Jan 10 2018

Keywords

Comments

The last term in this sequence is 2160. The reasons are as follows (let b, c, d, i, j, k, m, r, s, t, w, x, y and z be nonnegative integers).
For the Diophantine equation x^2 + y^2 + z^2 + w^7 = m:
(1) If m is not of the form 4^c * (8b + 7), then it follows from Legendre's three-square theorem that the equation has a solution with w = 0.
(2) 8b + 7 - 1^7 = 8b + 6. Then m = 8b + 7, the equation has a solution with w = 1.
(3) 4 * (8b + 7) - 1^7 = (8 * (4b + 3) + 3) = 8d + 3. Then m = 4 * (8b + 7), the equation has a solution with w = 1.
(4) For b >= 17, 16 * (8b + 7) - 3^7 = 8 * (16 * (b - 17) + 12) + 5 = 8i + 5. Then m = 16 * (8b + 7) and b >= 17, the equation has a solution with w = 3.
(5) 4^3 * (8b + 7) - 2^7 = 4^3 * (8b + 5). Then m = 4^3 * (8b + 7), the equation has a solution with w = 2. And 4^3 * (8b + 7) - 3^7 = 8 * (4^3 * (b - 4) + 38) + 5 = 8j + 5. Then m = 4^3 * (8b + 7) and b >= 4, the equation has a solution with w = 3.
(6) 4^4 * (8b + 7) - 2^7 = 4^3 * (8 * (4b + 3) + 3) = 4^3 * (8k + 3). 4^4 * (8b + 7) - 3^7 = 8 * (256b - 217) + 3 = 8r + 3. Then m = 4^4 * (8b + 7), the equation has a solution with w = 2 and when b > 0, the equation has a solution with w = 3.
(7) When c >= 5, 4^c * (8b + 7) - 2^7 = 4^3 * (8 * (b * 4^(c - 3) + 14 * 4^(c - 5) + 5) = 4^3 * (8s + 5). 4^c * (8b + 7) - 3^7 = 8 * (b * 4^(c - 3) + 14 * 4^(c - 3) - 273) + 3 = 8t + 3. Then n = 4^c * (8b + 7), the equation has solutions with w = 2 and 3.
In short, except for the 17 numbers in the sequence, every nonnegative integer can be represented as the sum of 3 squares and a nonnegative 7th power.

Crossrefs

Finite subsequence of A004215 and A296185.

Programs

  • Mathematica
    t1={};
    Do[Do[If[x^2+y^2+z^2+w^7==n, AppendTo[t1,n]&&Break[]], {x,0,n^(1/2)}, {y,x,(n-x^2)^(1/2)}, {z,y,(n-x^2-y^2)^(1/2)}, {w,0,(n-x^2-y^2-z^2)^(1/7)}], {n,0,3000}];
    t2={};
    Do[If[FreeQ[t1,k]==True, AppendTo[t2,k]], {k,0,3000}];
    t2

Formula

a(n) = 128n - 16 = 16 * A004771(n - 1), 1 <= n <= 17.

A001533 a(n) = (8*n+1)*(8*n+7).

Original entry on oeis.org

7, 135, 391, 775, 1287, 1927, 2695, 3591, 4615, 5767, 7047, 8455, 9991, 11655, 13447, 15367, 17415, 19591, 21895, 24327, 26887, 29575, 32391, 35335, 38407, 41607, 44935, 48391, 51975, 55687, 59527, 63495, 67591, 71815, 76167, 80647, 85255, 89991, 94855, 99847, 104967
Offset: 0

Views

Author

Keywords

Comments

From Klaus Purath, Aug 18 2022: (Start)
This is A028560(8*n+1), and thus a(n) + 9 is a square. (See formulas)
7 is the only prime number of this sequence in which all odd prime factors occur.
Each prime factor p appears exactly twice in any interval of p consecutive terms. If a(m) and a(n) are within such an interval containing p, then m + n == -1 (mod p). (End)

Crossrefs

Programs

Formula

a(n) = 4*A001539(n) - 5.
a(n) = 128*n + a(n-1) with a(0)=7. - Vincenzo Librandi, Nov 12 2010
Sum_{n>=0} 1/a(n) = (Psi(7/8)-Psi(1/8))/48 = 0.1580099..., see A250129. - R. J. Mathar, May 30 2022 [ = (sqrt(2)+1)*Pi/48. - Amiram Eldar, Sep 08 2022]
From Klaus Purath, Aug 18 2022: (Start)
a(n) = A028560(8*n+1).
a(n) + 9 = ((a(n+1) - a(n-1))/32)^2 = A017113(n)^2.
a(2*n) = (a(n+1) - a(n-1))*n + 7. (End)
From Amiram Eldar, Feb 19 2023: (Start)
a(n) = A017077(n)*A004771(n).
Sum_{n>=0} (-1)^n/a(n) = (cos(Pi/8) * log(cot(Pi/16)) + sin(Pi/8) * log(cot(3*Pi/16)))/12.
Product_{n>=0} (1 - 1/a(n)) = cosec(Pi/8)*cos(sqrt(5/2)*Pi/4).
Product_{n>=0} (1 + 1/a(n)) = cosec(Pi/8)*cos(sqrt(2)*Pi/4). (End)
G.f.: -(7+114*x+7*x^2)/(x-1)^3. - R. J. Mathar, Apr 23 2024
From Elmo R. Oliveira, Oct 25 2024: (Start)
E.g.f.: exp(x)*(7 + 64*x*(2 + x)).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

A102603 a(n) = 24*n + 21.

Original entry on oeis.org

21, 45, 69, 93, 117, 141, 165, 189, 213, 237, 261, 285, 309, 333, 357, 381, 405, 429, 453, 477, 501, 525, 549, 573, 597, 621, 645, 669, 693, 717, 741, 765, 789, 813, 837, 861, 885, 909, 933, 957, 981, 1005, 1029, 1053, 1077, 1101, 1125, 1149, 1173, 1197, 1221, 1245
Offset: 0

Views

Author

Alexandre Wajnberg, Jan 29 2005

Keywords

Crossrefs

Cf. A004771.

Programs

Formula

From Elmo R. Oliveira, Jul 01 2025: (Start)
G.f.: 3*(7 + x)/(1-x)^2.
E.g.f.: 3*(7 + 8*x)*exp(x).
a(n) = 3*A004771(n).
a(n) = 2*a(n-1) - a(n-2). (End)

Extensions

More terms from Elmo R. Oliveira, Jul 01 2025

A139405 Numbers k such that 8*k+1 and 8*k+7 are primes.

Original entry on oeis.org

2, 5, 9, 12, 24, 29, 32, 44, 54, 57, 74, 75, 80, 107, 110, 122, 129, 137, 152, 162, 165, 170, 179, 185, 194, 200, 207, 219, 222, 234, 249, 260, 267, 285, 297, 299, 302, 305, 332, 339, 362, 414, 432, 452, 470, 500, 509, 519, 555, 557, 564, 570, 582, 584, 599
Offset: 1

Views

Author

Artur Jasinski, Apr 19 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; Do[If[PrimeQ[8 n + 1] && PrimeQ[8 n + 7], AppendTo[a, n]], {n, 1, 1000}]; a

A362359 Triangle T read by rows, obtained from the array A for the solutions of the Monkey and Coconuts Problem (s sailors and one coconut to the monkey).

Original entry on oeis.org

1, 2, 7, 3, 15, 79, 4, 23, 160, 1021, 5, 31, 241, 2045, 15621, 6, 39, 322, 3069, 31246, 279931, 7, 47, 403, 4093, 46871, 559867, 5764795, 8, 55, 484, 5117, 62496, 839803, 11529596, 134217721, 9, 63, 565, 6141, 78121, 1119739, 17294397, 268435449, 3486784393, 10, 71, 646, 7165, 93746, 1399675, 23059198, 402653177, 6973568794, 99999999991
Offset: 1

Views

Author

Richard S. Fischer and Wolfdieter Lang, Jun 20 2023

Keywords

Comments

For the five sailors and one monkey problem see A254029.
The rows s of the array A give the positive solutions to the following problem: Recurrence co(k) = ((s-1)/s)*(co(k-1) - 1), for k >= 0, with co(0) = a, and the requirement c0(s) - 1 == 0 (mod s), for s >= 1. Then a = a(s, n) = A(s, n), for n >= 1.

Examples

			The array A begins:
s\n     1      2      3       4       5       6       7       8       9 ...
---------------------------------------------------------------------------
1:      1      2      3       4       5       6       7       8       9 ...
2:      7     15     23      31      39      47      55      63      71 ...
3:     79    160    241     322     403     484     565     646     727 ...
4:   1021   2045   3069    4093    5117    6141    7165    8189    9213 ...
5:  15621  31246  46871   62496   78121   93746  109371  124996  140621 ...
6: 279931 559867 839803 1119739 1399675 1679611 1959547 2239483 2519419 ...
...
s = 7: 5764795 11529596 17294397 23059198 28823999 34588800 40353601 46118402 51883203 57648004, ...
...
-----------------------------------------------------------------------------
The triangle begins:
  n\k  1  2   3    4     5       6        7         8          9          10
  ---------------------------------------------------------------------------
  1:   1
  2:   2  7
  3:   3 15  79
  4    4 23 160 1021
  5:   5 31 241 2045 15621
  6:   6 39 322 3069 31246  279931
  7:   7 47 403 4093 46871  559867  5764795
  8:   8 55 484 5117 62496  839803 11529596 134217721
  9:   9 63 565 6141 78121 1119739 17294397 268435449 3486784393
 10:  10 71 646 7165 93746 1399675 23059198 402653177 6973568794 99999999991
 ...
-----------------------------------------------------------------------------
		

Crossrefs

Rows of array A (columns of triangle T starting with index n): A000027, A004771(n-1), A362360, A362361, A254029.
First column of array A (diagonal of triangle T): A014293.

Programs

Formula

T(n, k) = A(k, n - k + 1), with the array A(s, n) = n*s^(s+1) - (s - 1), for s >= 1 and n >= 1. (Array read by antidiagonals downwards.)
T(n, k) = (n - k + 1)*k^(k+1) - (k - 1), for k = 1, 2, ..., n.
O.g.f. for row s of array A: (x/(1 - x)^2)*(s^(s + 1) - (s - 1)*(1 - x)).
E.g.f. for column n of array A: n*(-W(-x)/(1 - (-W(-x)))^3) - (1 - (1 - x)*exp(x)), with the principal branch of Lambert's W-function

A365868 Starts of runs of 3 consecutive integers that are divisible by the cube of their least prime factor.

Original entry on oeis.org

1375, 16119, 25623, 28375, 52623, 55375, 57967, 79623, 82375, 90207, 94471, 106623, 109375, 129623, 133623, 134431, 136375, 160623, 163375, 164295, 187623, 190375, 206143, 214623, 217375, 241623, 244375, 268623, 271375, 280231, 295623, 298375, 312471, 322623, 325375
Offset: 1

Views

Author

Amiram Eldar, Sep 21 2023

Keywords

Comments

Numbers k such that k, k+1 and k+2 are all terms of A365866.
Numbers of the form 4*k+2 are not terms of A365866. Therefore, there are no runs of 4 or more consecutive integers. Since the middle integer in each triple is divisible by 8, all the terms of this sequence are of the form 8*k+7.
The numbers of terms not exceeding 10^k, for k = 4, 5, ..., are , 1, 11, 109, 1092, 10899, 109125, 1091335, 10912897, ... . Apparently, the asymptotic density of this sequence exists and equals 0.0001091... .

Examples

			1375 is a term since 5 is the least prime factor of 1375 and 1375 is divisible by 5^3 = 125, 2 is the least prime factor of 1376 and 1376 is divisible by 2^3 = 8, and 3 is the least prime factor of 1377 and 1377 is divisible by 3^3 = 27.
		

Crossrefs

Cf. A067029.
Subsequence of A004771, A068140, A365866 and A365867.

Programs

  • Mathematica
    Select[8 * Range[41000] + 7, AllTrue[# + {0, 1, 2}, FactorInteger[#1][[1, -1]] >= 3 &] &]
  • PARI
    is(n) = factor(n)[1,2] >= 3;
    lista(kmax) = forstep(k = 7, kmax, 8, if(is(k) && is(k+1) && is(k+2), print1(k, ", ")));

A365888 Starts of run of 3 consecutive integers that are terms of A365886.

Original entry on oeis.org

3484375, 6640623, 13609375, 16765623, 23734375, 26890623, 33859375, 37015623, 43984375, 47140623, 54109375, 57265623, 64234375, 67390623, 74359375, 77515623, 84484375, 87640623, 94609375, 97765623, 104734375, 107890623, 114859375, 118015623, 124984375, 128140623
Offset: 1

Views

Author

Amiram Eldar, Sep 22 2023

Keywords

Comments

Numbers k such that k, k+1 and k+2 are all terms of A365886.
Numbers of the form 4*k+2 are not terms of A365886. Therefore there are no runs of 4 or more consecutive integers. Since the middle integer in each triple is even it must be and divisible by 8, so all the terms of this sequence are of the form 8*k+7.
The numbers of terms not exceeding 10^k, for k = 7, 8, ..., are 2, 20, 198, 1979, 19796, ... . Apparently, the asymptotic density of this sequence exists and equals 1.979...*10^(-7).

Examples

			3484375 = 5^6 * 223 is a term since its least prime factor, 5, is smaller than its exponent, 6, the least prime factor of 3484376 = 2^3 * 7 * 43 * 1447, 2, is smaller than its exponent, 3, and the least prime factor of 3484377 = 3^5 * 13 * 1103, 3, is also smaller than its exponent, 5.
		

Crossrefs

Subsequence of A004771, A365886 and A365887.

Programs

  • Mathematica
    q[n_] := Less @@ FactorInteger[n][[1]]; Select[8 * Range[10^6] + 7, AllTrue[# + {0, 1, 2}, q] &]
  • PARI
    is(n) = {my(f = factor(n)); n > 1 && f[1, 1] < f[1, 2];}
    lista(kmax) = forstep(k = 7, kmax, 8, if(is(k) && is(k+1) && is(k+2), print1(k, ", ")));
Previous Showing 21-30 of 44 results. Next