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 11-20 of 25 results. Next

A104157 Smallest of n^2 consecutive primes that form an n X n magic square with the least magic constant, or 0 if no such magic square exists.

Original entry on oeis.org

2, 0, 1480028129, 31, 13, 7, 7, 79, 37, 23, 67, 89, 13, 89, 131, 31, 71, 47, 43, 73, 277, 353, 41, 67, 127, 223, 79, 13, 193, 5, 23, 43, 5, 67, 3, 19, 5, 59, 59, 653, 19, 19, 97, 409, 5, 383, 29, 137, 379, 349, 653, 1187, 47, 41, 37, 17, 619, 89, 283, 283, 43, 479, 191
Offset: 1

Views

Author

Robert G. Wilson v, Mar 09 2005

Keywords

Comments

The magic constants (= sums) are given in A073520. For a given sum, the corresponding list of primes (and thus also the smallest one) is easily calculated, cf. PARI code. - M. F. Hasler, Oct 29 2018

References

  • H. L. Nelson, Journal of Recreational Mathematics, 1988, vol. 20:3, p. 214.
  • Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.

Crossrefs

Cf. A073519 or A320873 (the square for 3 X 3), A073520 (magic sums for 4 X 4 squares of consecutive primes), A073521 (consecutive primes of a 4 X 4 magic square), A073522 (consecutive primes of a (non minimal!) 5 X 5 magic square), A073523 (consecutive primes of a pandiagonal 6 X 6 magic square).

Programs

  • PARI
    A104157(n)=MagicPrimes(A073520[n],n)[1] \\ See A073519 for MagicPrimes(). This code uses a precomputed array A073520, but in practice one would rather compute that sequence as function of this one. - M. F. Hasler, Oct 29 2018

Formula

Conjecture: for n > 4, a(n) = prime(s) where s > 1 is the smallest integer such that (Sum_{i=s..s+n^2-1} prime(i))/n is an integer of the same parity as n. - Max Alekseyev, Jan 29 2010
a(n) = prime(i) such that Sum_{k=0..n^2-1} prime(i+k) = n*A073520(n). - M. F. Hasler, Oct 29 2018

Extensions

a(5)-a(6) corrected, a(7)-a(20) added by Max Alekseyev, Sep 24 2009
Definition edited by N. J. A. Sloane, Oct 03 2009
More terms from Max Alekseyev, Jan 29 2010

A177434 The magic constants of 6 X 6 magic squares composed of consecutive primes.

Original entry on oeis.org

484, 744, 806, 868, 930, 1390, 1460, 1494, 1634, 1704, 1740, 1848, 1992, 2100, 2172, 2316, 2390, 2540, 3116, 3192, 3694, 3734, 3774, 4486, 4946, 4988, 5736, 6104, 6148, 6526, 6568, 6610, 6776, 6820, 6950, 7036, 7078, 7120, 7984, 8118, 8162, 8828, 9318
Offset: 1

Views

Author

Natalia Makarova, May 08 2010

Keywords

Comments

Let Z be a sum of 36 consecutive primes. A necessary condition to get a 6 X 6 magic square using these primes is that Z=6S, where S is even. The smallest magic constant of a 6 X 6 magic square of consecutive primes is 484 (cf. A073520).
Each of the first 100 possible arrays of 36 consecutive primes which satisfy the necessary condition produces a magic square.
A program written by Stefano Tognon was used.

Examples

			S = 744
   [139 113 151 131  83 127]
   [223 149  89  47 157  79]
   [173 103 181 167  59  61]
   [ 67 137  53  97 211 179]
   [101 199  73 109  71 191]
   [ 41  43 197 193 163 107]
S = 806
   [131  53 107 157 191 167]
   [ 89 229 179  97 109 103]
   [ 83 211  71 139  79 223]
   [113 101 137 181 227  47]
   [197  61 163  59 127 199]
   [193 151 149 173  73  67]
S = 868
   [191 137  79 193 197  71]
   [ 67 157  73 229 239 103]
   [179 173 167  97 101 151]
   [211 181 223  61 109  83]
   [113 131 199 139  59 227]
   [107  89 127 149 163 233]
Magic square with S=930 can be pan-diagonal (cf. A073523).
Example of a non-pan-diagonal square:
S = 930
   [167  71 151 199 131 211]
   [ 89 241 181  73 113 233]
   [ 83 227 127 197 229  67]
   [239 137 139 103 163 149]
   [179  97 223 251 101  79]
   [173 157 109 107 193 191]
		

Crossrefs

Cf. A173981 (analog for 4 X 4), A176571 (analog for 5 X 5), A073523 (36 consecutive primes of a pandiagonal magic square), A073520 (smallest magic sum for n X n), A259733 (most-perfect 8 X 8), A272387 (smallest element of 6 X 6 magic squares of consecutive primes).

Programs

Formula

a(n) = Sum_{k=0..35} A000040(A000720(A272387(n))+k)/6. - M. F. Hasler, Oct 28 2018

Extensions

Edited by M. F. Hasler, Oct 28 2018

A073502 The smallest magic constant for n X n magic square with prime entries (regarding 1 as a prime).

Original entry on oeis.org

111, 102, 213, 408, 699, 1114, 1681, 2416, 3355, 4514, 5937, 7626, 9635, 11986, 14691, 17818, 21373, 25394, 29873, 34926, 40511, 46664, 53445, 60898, 69045, 77888, 87473, 97850, 109065, 121126, 134113, 147982, 162759
Offset: 3

Views

Author

N. J. A. Sloane, Aug 27 2002

Keywords

Comments

Until the early part of the twentieth century 1 was regarded as a prime (see A008578).

References

  • W. S. Andrews and H. A. Sayles, The Monist (Chicago) for October 1913.
  • H. E. Dudeney, Amusements in Mathematics, Nelson, London, 1917, page 125, who quotes the Andrews-Sayles article as his source.

Crossrefs

Cf. A073473 (for the n=3 square), A024351, A073520, A164843, A173079.

Extensions

Dudeney gives 36095/11 for n = 11 (an obvious typo) and 4514 for n = 12
a(3)-a(12) are confirmed/given by Chebrakov
a(15), a(17), a(22), a(35), and a(124)=9912840 from S. Tognon (cf. A173079)
a(13)-a(14), a(16), a(18)-a(21), a(23)-a(34) from N. Makarova
Edited by Max Alekseyev, Feb 11 2010

A245721 The set of 16 consecutive primes forming a 4 X 4 pandiagonal magic square with the smallest magic constant, 682775764735680 = A256234(1).

Original entry on oeis.org

170693941183817, 170693941183847, 170693941183859, 170693941183861, 170693941183889, 170693941183891, 170693941183903, 170693941183907, 170693941183933, 170693941183937, 170693941183949, 170693941183951, 170693941183979, 170693941183981, 170693941183993, 170693941184023
Offset: 1

Views

Author

Max Alekseyev, Jul 30 2014

Keywords

Comments

Also, the set of 16 smallest consecutive primes forming a 4x4 Stanley antimagic square.
The set of primes is uniquely and straightforwardly determined by the magic sum, here A256234(1), cf. PROGRAM. See A320874 for the ordered list, i.e., the lexicographic smallest magic square made of these primes. - M. F. Hasler, Oct 23 2018

Examples

			A pandiagonal magic square formed by these primes:
  170693941183817 170693941183933 170693941183949 170693941183981
  170693941183979 170693941183951 170693941183847 170693941183903
  170693941183891 170693941183859 170693941184023 170693941183907
  170693941183993 170693941183937 170693941183861 170693941183889
A Stanley antimagic square formed by these primes:
  170693941183817 170693941183859 170693941183907 170693941183949
  170693941183847 170693941183889 170693941183937 170693941183979
  170693941183861 170693941183903 170693941183951 170693941183993
  170693941183891 170693941183933 170693941183981 170693941184023
		

Crossrefs

Cf. A320874 (the square made of the set of primes given here).
Cf. A073519 or A320873, A073521, A073522 (3 X 3, 4 X 4 and 5 X 5 consecutive primes), A073523 and A320876 (6 X 6 consecutive primes, pandiagonal magic square).
Cf. A210710: Minimal index of a Stanley antimagic square of order n consisting of distinct primes.
Cf. A073520: Smallest magic sum of a magic square made of n^2 consecutive primes.
Cf. A104157: Smallest of n X n consecutive primes forming a magic square.
Cf. A256234: Magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.

Programs

A320876 Lexicographically first 6 X 6 pandiagonal magic square made of consecutive primes with the smallest magic constant (930).

Original entry on oeis.org

67, 139, 241, 73, 199, 211, 193, 233, 97, 167, 103, 137, 71, 113, 191, 131, 227, 197, 251, 181, 89, 229, 101, 79, 109, 157, 163, 151, 127, 223, 239, 107, 149, 179, 173, 83
Offset: 1

Views

Author

M. F. Hasler, Oct 22 2018

Keywords

Comments

The same 6 X 6 terms are given in increasing order in sequence A073523. But giving them in increasing order does not contain more information as the smallest of them or magic constant (= sum) itself, which uniquely determines the sequence of primes since they have to be consecutive and their sum is equal to 6 times the magic constant. The present sequence gives the full information about the magic square.
A pandiagonal magic square allows rotations (rather than arbitrary cyclic permutations) of columns or rows, as well as reflection on the 4 symmetry axes of the square. Considering all these variants of this square, there is none with elements coming earlier than (67, 139, ...)
There exist non-pandiagonal 6 X 6 magic squares composed of consecutive primes with smaller magic constant, the smallest being A073520(6) = 484.
Pandiagonal means that not only the 2 main diagonals, but all other 10 diagonals also have the same sum, Sum_{i=1..6} A[i,M6(k +/- i)] = 930 for k = 1, ..., 6 and M6(x) = y in {1, ..., 6} such that y == x (mod 6).

Examples

			The magic square is
  [ 67 139 241  73 199 211]
  [193 233  97 167 103 137]
  [ 71 113 191 131 227 197]
  [251 181  89 229 101  79]
  [109 157 163 151 127 223]
  [239 107 149 179 173  83]
		

References

  • Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 23:3, 1991, pp. 190-191.
  • Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.

Crossrefs

Programs

  • PARI
    /* the following transformation operators for matrices, together with transposition, allow the production of all variants of a (pandiagonal) magic square */
    REV(M)=matconcat(Vecrev(M)) \\ reverse the order of columns of M
    FLIP(M)=matconcat(Colrev(M)) \\ reverse the order of row of M
    ROT(M,k=1)=matconcat([M[,k+1..#M],M[,1..k]]) \\ rotate left by k (default: 1) columns
    ALL(M)=Set(concat(apply(M->vector(#M,k,ROT(M,k)),[M,M~,REV(M),REV(M~),FLIP(M),FLIP(M~)]))) \\ PARI orders the set according to the (first) columns of the matrices, so one must take the transpose to get them ordered according to elements of the first row.
    MagicPrimes(S=930,n=6,P=[nextprime(S\n)])={S=n*S-P[1];for(i=1,-1+n*=n,S-=if(S>(n-i)*P[1],P=concat(P,nextprime(P[#P]+1));P[#P],P=concat(precprime(P[1]-1),P);P[1]));if(S,-P,P)} \\ The vector of n^2 primes whose sum is n*S (= A073523 for default values), or a negative vector of "best approximation" if there is no exact solution.

A189188 Potential magic constants of 8 X 8 magic squares composed of consecutive primes.

Original entry on oeis.org

2016, 2244, 2336, 2570, 2762, 4106, 4362, 4464, 4566, 4670, 4776, 4934, 5952, 6870, 7036, 7146, 7588, 7644, 7700, 8824, 9756, 9930, 9988, 10394, 10454, 10514, 10690, 10868, 10928, 11560, 12620, 12682, 14986, 15424, 15808, 16000, 16510, 18668, 20434
Offset: 1

Views

Author

Natalia Makarova, Apr 18 2011

Keywords

Comments

For an 8 X 8 magic square composed of 64 consecutive primes, it is necessary that the sum of these primes is a multiple of 16.
This sequence consists of even integers equal to the sum of 64 consecutive primes divided by 8. It is not known whether each such set of consecutive primes can be arranged into an 8 X 8 magic square but it looks plausible.
From A.H.M. Smeets, Jan 20 2021: (Start)
Except from the condition that a magic constant exists, it must be an even magic constant due to the fact that the order is even, which explains why the sum of primes must be divisable by 16.
The number of possible combinations of 8 primes out of the 64 consecutive primes added results in the magic constant is such that in almost all cases such a magic square existsts. However, as n increases, the diversity in prime gaps between the 64 consecutive primes increases, and thus the probability that a potential magic constant will lead to a magic square configuration will decrease. The challenge here seems to be to find a potential magic constant which has no magic square configuration. (End)

Examples

			a(1) = 2016
  [ 79 137 197 199 277 347 349 431
   127 193 131 419 337 421 107 281
   103 379 283 389 293 227 179 163
   397 251  83 271 269 157 439 149
   409 211 383 191 181 101 401 139
   307 239 317 167  89 367  97 433
   353 233 359 151 257 223 331 109
   241 373 263 229 313 173 113 311 ]
.
a(12) = 4934
  [ 823 619 461 457 631 587 599 757
    443 563 647 509 733 761 787 491
    503 809 419 701 661 797 487 557
    683 499 743 677 449 607 617 659
    439 727 571 577 719 821 601 479
    811 641 593 523 421 467 709 769
    691 433 673 751 773 431 613 569
    541 643 827 739 547 463 521 653 ]
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
           `if` (n=1, add (ithprime(i), i=1..64),
                      ithprime(n+63) -ithprime(n-1) +s(n-1))
        end:
    a:= proc(n) option remember; local k, m; a(n-1);
           for k from 1+b(n-1) while irem(s(k), 16, 'm')<>0 do od;
           b(n):= k; 2*m
        end:
    a(0):=0: b(0):=0:
    seq(a(n), n=1..50);

Extensions

Edited by Max Alekseyev, Jun 18 2011

A320871 List of all inequivalent 3 X 3 magic squares made of distinct positive integers, sorted by increasing sum. For each equivalence class modulo symmetries of the square, the lexicographically smallest representative is shown.

Original entry on oeis.org

2, 7, 6, 9, 5, 1, 4, 3, 8, 2, 9, 7, 11, 6, 1, 5, 3, 10, 3, 7, 8, 11, 6, 1, 4, 5, 9, 3, 8, 7, 10, 6, 2, 5, 4, 9, 2, 11, 8, 13, 7, 1, 6, 3, 12, 3, 10, 8, 12, 7, 2, 6, 4, 11, 4, 8, 9, 12, 7, 2, 5, 6, 10, 4, 9, 8, 11, 7, 3, 6, 5, 10, 2, 13, 9, 15, 8, 1, 7, 3, 14, 3, 11, 10, 15, 8, 1, 6, 5, 13
Offset: 1

Views

Author

M. F. Hasler, Oct 28 2018

Keywords

Comments

"Symmetries of the square" means the symmetry group D4 consisting of reflections on any of the 4 symmetry axes of the square (horizontal H, vertical V, 2 diagonals D & A), which also generates the rotations around the center by multiples of 90°, R1, R2, R3 (and R0 = id): e.g., H o D = R1, where D means to transpose the 3 X 3 matrix, H means reversal of the rows, etc.
The 8 ("equivalent") variants of the first square are listed in A217568.

Examples

			The first five inequivalent magic squares (with magic sums 15, 18, 18, 18, 21) are
   [2 7 6]    [ 2 9  7]    [ 3 7 8]    [ 3 8 7]    [ 2 11  8]
   [9 5 1]    [11 6  1]    [11 6 1]    [10 6 2]    [13  7  1]
   [4 3 8]    [ 5 3 10]    [ 4 5 9]    [ 5 4 9]    [ 6  3 12]
They are listed as rows of the 9 elements of each square, so the first row is:
  [2, 7, 6; 9, 5, 1; 4, 3, 8],
the second row is:
  [2, 9, 7; 11, 6, 1; 5, 3, 10], and so on.
		

Crossrefs

Cf. A217568: the 8 equivalent variants of the first row.
Cf. A320872: subsequence of rows that consist only of primes; A268790 lists their magic sums with duplicates removed.
Cf. A320873: the first row that consists of a set of consecutive primes; it has magic sum = 4440084513 = A270305(1) = A073520(3).

Programs

  • PARI
    A320871_row(N=10,show_all=1,c=3)={for(c=c,oo, forstep(d=c-1,2,-1, for(b=max(2*d+1-c,1), d-1, d!=2*b&& S=[c-d,c+b,c+d-b;c+2*d-b,c,c-2*d+b;c-d+b,c-b,c+d]; !(show_all&&print(S))&& !N--&& return(S))))} \\ The third (optional) argument allows starting the list with the first square(s) having the central element >= c, i.e., magic sum >= 3c.

A320874 Lexicographically first 4 X 4 pandiagonal magic square made of consecutive primes.

Original entry on oeis.org

170693941183817, 170693941183933, 170693941183949, 170693941183981, 170693941183979, 170693941183951, 170693941183847, 170693941183903, 170693941183891, 170693941183859, 170693941184023, 170693941183907, 170693941183993, 170693941183937, 170693941183861, 170693941183889
Offset: 1

Views

Author

M. F. Hasler, Oct 22 2018

Keywords

Comments

This is also the 4 X 4 pandiagonal magic square made of consecutive primes which has the smallest possible magic constant (= sum), 682775764735680 = A256234(1). (In the present case there is no other non-equivalent pandiagonal 4 X 4 magic square having the same magic sum, but this could be possible as for rows 7 and 8 of A320872.)
There exist many non-pandiagonal 4 X 4 magic squares composed of consecutive primes with much smaller magic constant, the smallest being A073520(4) = 258.
Pandiagonal means that not only the 2 main diagonals, but also the 6 other "broken" diagonals all have the same sum, Sum_{i=1..4} A[i,M4(k +- i)] = 682775764735680 for k = 1, ..., 4 and M4(x) = y in {1, ..., 4} such that y == x (mod 4).
A pandiagonal magic square allows rotations (but not arbitrary cyclic permutations like, e.g., 1 -> 3 -> 4 -> 1) of columns or rows, as well as reflection on the 4 symmetry axes of the square (which also produce rotations of 90 degrees around the center of the square). Among all these variants of this square, there is none with elements coming earlier than (170693941183817, 170693941183933, ...), cf. PROGRAM for explicit verification.
The same 4 X 4 primes are given in increasing order in sequence A245721. But does not give more information than smallest term, the central term, or the magic constant itself (cf. A256234) which uniquely determines the sequence of primes (cf. PARI code) since they have to be consecutive and their sum is equal to 4 times the magic constant. The present sequence gives the full information about the magic square, and the given PARI code allows the production of all "equivalent" variants of the square.

Examples

			The magic square is
  [ 170693941183817 170693941183933 170693941183949 170693941183981 ]
  [ 170693941183979 170693941183951 170693941183847 170693941183903 ]
  [ 170693941183891 170693941183859 170693941184023 170693941183907 ]
  [ 170693941183993 170693941183937 170693941183861 170693941183889 ]
		

References

  • Allan W. Johnson, Jr., Journal of Recreational Mathematics, vol. 23:3, 1991, pp. 190-191.
  • Clifford A. Pickover, The Zen of Magic Squares, Circles and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002.

Crossrefs

Cf. A073519 and A320873, A073521, A073522 (3 X 3, 4 X 4 and 5 X 5 consecutive primes), A073523 and A320876 (6 X 6 consecutive primes, pandiagonal magic square).
Cf. A210710: Minimal index of a Stanley antimagic square of order n consisting of distinct primes.
Cf. A073520: Smallest magic sum for an n^2 magic square made of consecutive primes.
Cf. A104157: Smallest of n X n consecutive primes forming a magic square.
Cf. A256234: Magic sums of 4 X 4 pandiagonal magic squares of consecutive primes.

Programs

  • PARI
    /* the following transformation operators for matrices, together with transposition, allow the production of all (24 for n=4) variants of a (pandiagonal) magic square */
    REV(M)=matconcat(Vecrev(M)) \\ reverse the order of columns of M
    FLIP(M)=matconcat(Colrev(M)) \\ reverse the order of rows of M
    ROT(M,k=1)=matconcat([M[,k+1..#M],M[,1..k]]) \\ rotate left by k (default: 1) columns
    ALL(M)=Set(concat(apply(M->vector(#M,k,ROT(M,k)),[M,M~,REV(M),REV(M~),FLIP(M),FLIP(M~)]))) \\ PARI orders the set according to the (first) columns of the matrices, so one must take the transpose to get them ordered according to elements of the first row.
    \\ The set of primes is A245721=MagicPrimes(682775764735680,4), cf. A073519.

A173079 Positive integers n such that the sum S of 1 and first n^2-1 odd primes is divisible by n and S/n == n (mod 2).

Original entry on oeis.org

1, 2, 3, 12, 15, 17, 22, 35, 124, 191, 774, 1405, 1522, 3988, 6220, 7448, 8038, 11404, 63027, 161153, 582096
Offset: 1

Views

Author

Max Alekseyev, Feb 09 2010

Keywords

Comments

A necessary condition for the existence of n X n magic square consisting of 1 and the first n^2-1 odd primes.
In 1913, J. N. Muncey proved that 12 is actually the smallest (nontrivial) order for which such a magic square exists.
Squares of order 15, 17, 22, 35 and 124 were constructed by S. Tognon.
From A.H.M. Smeets, Mar 10 2021: (Start)
The number S/n, if it exists, is also called the potential magic constant.
It is believed that the corresponding magic squares do exist for any order a(n) with n >= 4. (End)
No other terms below 3*10^6. - Max Alekseyev, Nov 07 2024

Examples

			From _A.H.M. Smeets_, Mar 10 2021: (Start)
The case a(1) = 1 is trivial.
In case a(2) = 2, the set of potential magic square numbers is {1, 3, 5, 7} with potential magic constant 8, however, no magic square exists of order 2.
In case a(4) = 12, not only the potential magic constant exists, but also the magic square itself, as shown by Stefano Tognon or Eric Weisstein's World of Mathematics. (End)
		

Crossrefs

Extensions

a(20) from Donovan Johnson, Nov 30 2010
a(1)=1 prepended by A.H.M. Smeets, Mar 10 2021
a(21) from Max Alekseyev, Nov 01 2024

A191679 Potential magic constants of 9 X 9 magic squares composed of consecutive primes.

Original entry on oeis.org

2211, 2261, 2311, 2463, 2725, 4257, 6125, 6611, 7821, 9841, 9973, 10303, 10499, 10631, 10953, 11987, 12115, 12179, 12243, 12309, 12375, 12637, 12837, 13497, 13695, 14169, 15063, 15395, 16207, 16483, 16821, 17605, 17891, 19017, 20345, 20487, 21135, 22539, 22811, 23219, 23985
Offset: 1

Views

Author

Natalia Makarova, Jun 11 2011

Keywords

Comments

For a 9 X 9 magic square composed of 81 consecutive primes, it is necessary that the sum of these primes is a multiple of 9.
This sequence consists of integers equal the sum of 81 consecutive primes divides by 9. It is not known whether each such set of consecutive primes can be arranged into 9 X 9 magic square but it looks plausible.

Examples

			a(1)=2211 for a square containing prime(12)..prime(92):
  [37 127 163 179 229 233 379 421 443
   41 431 463 457  59 139 433 109  79
  409 311 389  71 307 347 281  53  43
  373 137 181 251 401 239 317  89 223
  173 419 101 103 113 353 313 277 359
   97 383 397 479  47 197 107 263 241
  349 131 193 149 367 199  73 467 283
  439  61 257 191 227 167 151 449 269
  293 211  67 331 461 337 157  83 271]
a(2)=2261 for a square containing prime(13)..prime(93):
  [41  379  281  467  349  257  229  199   59
  313  223  127  337  131  101  479  107  443
  409   71  331   79  137  263  347  271  353
  211  307  487  149  251  293  181  113  269
  191  419  109  439  173  233  103  397  197
   97  283  193  317  433  457  241  157   83
  461  139  239  359  373  179   67  401   43
   89  277   73   53  367  167  463  389  383
  449  163  421   61   47  311  151  227  431]
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember;
           `if` (n=1, add (ithprime(i), i=1..81),
                      ithprime(n+80) -ithprime(n-1) +s(n-1))
        end:
    a:= proc(n) option remember; local k, m;
           a(n-1);
           for k from 1+b(n-1) while irem (s(k), 9, 'm')<>0 do od;
           b(n):= k; m
        end:
    a(0):=0: b(0):=0:
    seq (a(n), n=1..50);
  • Mathematica
    Total[#]/9&/@Select[Partition[Prime[Range[500]],81,1],Divisible[ Total[ #],9]&] (* Harvey P. Dale, Jan 08 2014 *)

Extensions

Edited by Max Alekseyev, Jun 18 2011
Previous Showing 11-20 of 25 results. Next