%I M2633 N1044 #33 Jul 03 2019 05:05:23
%S 1,3,7,12,20,30,44,59,75,96,118,143,169,197,230,264,299,335,373,413,
%T 455,501,549,598,648,701,758,818,880,944,1009,1079,1156,1236,1317,
%U 1400,1485,1571,1661,1752,1844,1944,2048,2155,2263,2379,2498,2622,2749,2881
%N Prime numbers of measurement.
%C Partial sums of A002048. - _Reinhard Zumkeller_, May 23 2013
%D R. K. Guy, Unsolved Problems in Number Theory, E30.
%D Porubský, Š. On MacMahon's segmented numbers and related sequences. Nieuw Arch. Wisk. (3) 25 (1977), no. 3, 403--408. MR0485763 (58 #5575)
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Reinhard Zumkeller, <a href="/A002049/b002049.txt">Table of n, a(n) for n = 1..3000</a>
%H G. E. Andrews, <a href="http://www.jstor.org/stable/2318498">MacMahon's prime numbers of measurement</a>, Amer. Math. Monthly, 82 (1975), 922-923.
%H R. L. Graham and C. B. A. Peck, <a href="http://www.jstor.org/stable/2315138">Problem E1910</a>, Amer. Math. Monthly, 75 (1968), 80-81.
%H P. A. MacMahon, <a href="https://www.biodiversitylibrary.org/item/88477#page/679/mode/1up">The prime numbers of measurement on a scale</a>, Proc. Camb. Phil. Soc. 21 (1923), 651-654; reprinted in Coll. Papers I, pp. 797-800.
%F Andrews conjectures that a(n) ~ (1/2) n^2 log n / loglog n. - _N. J. A. Sloane_, Dec 01 2013
%t A002048[anmax_] := (a = {}; Do[AppendTo[a, i], {i, 1, anmax}]; asum = {a[[1]] + a[[2]], a[[2]]}; Do[AppendTo[asum, 0], {i, 3, anmax}]; piv = 3; While[piv <= Length[a], Do[a = DeleteCases[a, asum[[i]]], {i, 1, piv - 2}]; Do[asum[[i]] += a[[piv]], {i, 1, piv}]; piv = piv + 1;]; a); A002048[200] // Accumulate (* _Jean-François Alcover_, Oct 05 2016, adapted from _R. J. Mathar_'s Maple code in A002048. *)
%o (Haskell)
%o import Data.List ((\\))
%o a002049 n = a002049_list !! (n-1)
%o a002049_list = g [1..] [] where
%o g (x:xs) ys = (last zs) : g (xs \\ zs) (x : ys) where
%o zs = scanl (+) x ys
%o -- _Reinhard Zumkeller_, May 23 2013
%Y Cf. A002048.
%Y a(n) = A004978(n+1)-1 = A048204(n-1)+1.
%K nonn,nice
%O 1,2
%A _N. J. A. Sloane_.