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.

Showing 1-10 of 19 results. Next

A112877 Zeros in Cald's sequence: positions k such that A006509(k) = 0.

Original entry on oeis.org

117, 199, 381, 427, 521, 721, 1151, 1997, 3625, 6607, 12269, 23209, 41133, 75441, 141209, 266969, 507701, 968373, 1851971, 3549473, 6817481, 13115259, 25267949, 48750929, 94173137, 182122379, 352587759, 683348381, 1325663485, 2419811401, 4551835269, 8705190801, 16798251617, 32575310493
Offset: 1

Views

Author

Klaus Brockhaus, Oct 24 2005

Keywords

Examples

			A006509(117) = 0 and A006509(k) > 0 for k < 117, so a(1) = 117.
		

Crossrefs

A370951 gives first differences.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{b = a[n - 1], p = Prime[n - 1]}, If[ b - p > 0 && Position[t, b - p] == {}, b - p, If[ Position[t, b + p] == {}, b + p, 0]]]; t = {1}; Do[ AppendTo[t, a[n]], {n, 2, 270000}]; Flatten[ Position[t, 0]] (* Robert G. Wilson v, Oct 29 2005 *)
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A112877_gen(): # generator of terms
        a, aset, p = 1, {1}, 2
        for c in count(2):
            if (b:=a-p) > 0 and b not in aset:
                a = b
            elif (b:=a+p) not in aset:
                a = b
            else:
                a = 0
                yield c
            aset.add(a)
            p = nextprime(p)
    A112877_list = list(islice(A112877_gen(),10)) # Chai Wah Wu, Mar 04 2024

Extensions

a(15) and a(16) from Robert G. Wilson v, Oct 29 2005
a(17) and a(18) from Klaus Brockhaus, Jan 01 2006
a(19)-a(26) from Donovan Johnson, Feb 18 2010
a(27)-a(29) from Chai Wah Wu, Mar 04 2024
a(30)-a(34) from Martin Ehrenstein, Mar 07 2024 (see A370951)
More than the usual number of terms are shown in order to include the new terms from A370951. - N. J. A. Sloane, Mar 10 2024

A370951 First differences of A112877 (zero terms in Cald's sequence A006509).

Original entry on oeis.org

82, 182, 46, 94, 200, 430, 846, 1628, 2982, 5662, 10940, 17924, 34308, 65768, 125760, 240732, 460672, 883598, 1697502, 3268008, 6297778, 12152690, 23482980, 45422208, 87949242, 170465380, 330760622, 642315104, 1094147916, 2132023868, 4153355532, 8093060816, 15777058876
Offset: 1

Views

Author

N. J. A. Sloane, Mar 07 2024

Keywords

Comments

The terms essentially double at each step. The ratios of successive terms are 2.219512195, 0.2527472527, 2.043478261, 2.127659574, 2.150000000, 1.967441860, 1.924349882, 1.831695332, 1.898725687, 1.932179442, 1.638391225, 1.914081678, 1.916987292, 1.912176134, 1.914217557, 1.913630095, 1.918063177, 1.921124765, 1.925186539, 1.927099934, 1.929679007, 1.932327740, 1.934260814, 1.936260826, 1.938224550, 1.940338983, 1.941933414, 1.703444165, 1.948570058, 1.948081161, 1.948559605, 1.949455124...

Crossrefs

Programs

  • Mathematica
    nn = 2^20; c[_] := False; a[1] = j = 1; c[1] = True;
    Differences@ Monitor[Reap[
        Do[p = Prime[n - 1];
         If[And[# > 0, ! c[#]], k = #,
            If[c[#], k = 0; Sow[n], k = #] &[j + p]] &[j - p];
    Set[{c[k], j}, {True, k}], {n, 2, nn}]][[-1, 1]], n] (* Michael De Vlieger, Mar 07 2024 *)
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A370951_gen(): # generator of terms
        a, aset, p, q = 1, {1}, 2, 0
        for c in count(2):
            if (b:=a-p) > 0 and b not in aset:
                a = b
            elif (b:=a+p) not in aset:
                a = b
            else:
                a = 0
                if q:
                    yield c-q
                q = c
            aset.add(a)
            p = nextprime(p)
    A370951_list = list(islice(A370951_gen(),10)) # Chai Wah Wu, Mar 07 2024

Extensions

a(29)-a(33) from Martin Ehrenstein, Mar 07 2024

A100298 Similar to Cald's sequence (A006509), but move by the n-th composite instead of by the n-th prime.

Original entry on oeis.org

1, 5, 11, 3, 12, 2, 14, 28, 13, 29, 47, 27, 6, 0, 24, 49, 23, 50, 22, 52, 20, 53, 19, 54, 18, 56, 17, 57, 15, 59, 104, 58, 10, 0, 0, 51, 103, 157, 102, 46, 0, 0, 60, 122, 185, 121, 186, 120, 188, 119, 189, 117, 43, 118, 42, 0, 78, 158, 77, 159, 75, 160, 74, 161, 73, 163, 72
Offset: 1

Views

Author

Leroy Quet, Oct 13 2005

Keywords

Examples

			The 4th term is 3 and the 4th composite is 9.
3 - 9 is negative, so instead add 9 to 3 to get 12, which becomes the 5th term because 12 is not among the earlier terms of the sequence.
		

Crossrefs

Programs

  • Mathematica
    composite[n_] := FixedPoint[ n + PrimePi[#] + 1 & , n + PrimePi[n] + 1]; lst = {1}; Do[b = Last[lst]; p = composite[Length[lst]]; If[b > p && ! MemberQ[lst, b - p], AppendTo[lst, b - p], If[ ! MemberQ[lst, b + p], AppendTo[lst, b + p], AppendTo[lst, 0]]], {100}]; lst (* Jean-François Alcover, Nov 15 2013, after A006509 and Robert G. Wilson v *)

Extensions

More terms from Klaus Brockhaus, Oct 17 2005

A111338 Conjectured values of Cald's sequence A006509 after sorting and removal of duplicate zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 11, 12, 15, 16, 18, 19, 24, 26, 29, 32, 34, 35, 36, 38, 44, 52, 56, 61, 62, 63, 67, 68, 70, 71, 73, 76, 77, 80, 81, 83, 84, 85, 94, 98, 100, 106, 116, 122, 124, 136, 138, 140, 142, 148, 162, 164, 166, 168, 170, 174, 185, 193, 199, 207, 209, 215, 261
Offset: 1

Views

Author

Klaus Brockhaus, Nov 02 2005

Keywords

Comments

In other words, this is conjecturally the range of A006509. - M. F. Hasler, Mar 06 2024
Complement is A111339.

Crossrefs

Extensions

Name edited by M. F. Hasler, Mar 06 2024
Edited by N. J. A. Sloane, Mar 06 2024

A111339 Conjectured to be the numbers that do not appear in A006509.

Original entry on oeis.org

5, 7, 8, 9, 10, 13, 14, 17, 20, 21, 22, 23, 25, 27, 28, 30, 31, 33, 37, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 57, 58, 59, 60, 64, 65, 66, 69, 72, 74, 75, 78, 79, 82, 86, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 99, 101, 102, 103, 104, 105, 107, 108, 109
Offset: 1

Views

Author

Klaus Brockhaus, Nov 02 2005

Keywords

Comments

Conjectured to be the complement of A111338.
There is no known proof that any of these terms is missing from A006509. - N. J. A. Sloane, Mar 06 2024
5 does not appear in the first 10^8 terms of A006509. - Robert C. Lyons, Mar 06 2024

Crossrefs

Extensions

Edited by N. J. A. Sloane, Mar 06 2024

A117129 Primes not occurring as |differences| in Cald's sequence A006509.

Original entry on oeis.org

641, 1213, 2617, 2957, 3727, 5443, 9283, 17359, 33829, 66173, 131303, 264763, 494743, 957547, 1888157, 3753647, 7490797, 14961157, 29899357, 59773871, 119551489, 239106347, 478234723, 956607929, 1913366111, 3826828409, 7653840367, 15308666783, 30619196381, 57415599151
Offset: 1

Views

Author

N. J. A. Sloane, Apr 20 2006

Keywords

Comments

In other words, primes that do not occur as absolute values of differences of successive terms in Cald's sequence A006509.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import nextprime
    def A117129_gen(): # generator of terms
        a, aset, p = 1, {1}, 2
        for c in count(2):
            if (b:=a-p) > 0 and b not in aset:
                a = b
            elif (b:=a+p) not in aset:
                a = b
            else:
                a = 0
                yield p
            aset.add(a)
            p = nextprime(p)
    A117129_list =  list(islice(A117129_gen(),10)) # Chai Wah Wu, Mar 04 2024

Formula

a(n) = prime(A112877(n) - 1).

Extensions

a(19)-a(26) from Donovan Johnson, Feb 18 2010
a(27)-a(29) from Chai Wah Wu, Mar 04 2024
a(30) from Chai Wah Wu, Mar 10 2024

A002387 Least k such that H(k) > n, where H(k) is the harmonic number Sum_{i=1..k} 1/i.

Original entry on oeis.org

1, 2, 4, 11, 31, 83, 227, 616, 1674, 4550, 12367, 33617, 91380, 248397, 675214, 1835421, 4989191, 13562027, 36865412, 100210581, 272400600, 740461601, 2012783315, 5471312310, 14872568831, 40427833596, 109894245429, 298723530401, 812014744422
Offset: 0

Views

Author

Keywords

Comments

From Dean Hickerson, Apr 19 2003: (Start)
For k >= 1, log(k + 1/2) + gamma < H(k) < log(k + 1/2) + gamma + 1/(24k^2), where gamma is Euler's constant (A001620). It is likely that the upper and lower bounds have the same floor for all k >= 2, in which case a(n) = floor(exp(n-gamma) + 1/2) for all n >= 0.
This remark is based on a simple heuristic argument. The lower and upper bounds differ by 1/(24k^2), so the probability that there's an integer between the two bounds is 1/(24k^2). Summing that over all k >= 2 gives the expected number of values of k for which there's an integer between the bounds. That sum equals Pi^2/144 - 1/24 ~ 0.02687. That's much less than 1, so it is unlikely that there are any such values of k.
(End)
Referring to A118050 and A118051, using a few terms of the asymptotic series for the inverse of H(x), we can get an expression which, with greater likelihood than mentioned above, should give a(n) for all n >= 0. For example, using the same type of heuristic argument given by Dean Hickerson, it can be shown that, with probability > 99.995%, we should have, for all n >= 0, a(n) = floor(u + 1/2 - 1/(24u) + 3/(640u^3)) where u = e^(n - gamma). - David W. Cantrell (DWCantrell(AT)sigmaxi.net)
For k > 1, H(k) is never an integer. Hence apart from the first two terms this sequence coincides with A004080. - Nick Hobson, Nov 25 2006

References

  • John H. Conway and R. K. Guy, "The Book of Numbers," Copernicus, an imprint of Springer-Verlag, NY, 1996, pages 258-259.
  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 83, p. 28, Ellipses, Paris 2008.
  • Ronald Lewis Graham, Donald Ervin Knuth and Oren Patashnik, "Concrete Mathematics, a Foundation for Computer Science," Addison-Wesley Publishing Co., Reading, MA, 1989, Page 258-264, 438.
  • H. P. Robinson, Letter to N. J. A. Sloane, Oct 23 1973.
  • W. Sierpiński, Sur les decompositions de nombres rationnels, Oeuvres Choisies, Académie Polonaise des Sciences, Warsaw, Poland, 1974, p. 181.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane, Illustration for sequence M4299 (=A007340) in The Encyclopedia of Integer Sequences (with Simon Plouffe), Academic Press, 1995.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • I. Stewart, L'univers des nombres, pp. 54, Belin-Pour La Science, Paris 2000.

Crossrefs

Apart from initial terms, same as A004080.

Programs

  • Haskell
    a002387 n = a002387_list !! n
    a002387_list = f 0 1 where
       f x k = if hs !! k > fromIntegral x
               then k : f (x + 1) (k + 1) else f x (k + 1)
               where hs = scanl (+) 0 $ map recip [1..]
    -- Reinhard Zumkeller, Aug 04 2014
  • Mathematica
    fh[0]=0; fh[1]=1; fh[k_] := Module[{tmp}, If[Floor[tmp=Log[k+1/2]+EulerGamma]==Floor[tmp+1/(24k^2)], Floor[tmp], UNKNOWN]]; a[0]=1; a[1]=2; a[n_] := Module[{val}, val=Round[Exp[n-EulerGamma]]; If[fh[val]==n&&fh[val-1]==n-1, val, UNKNOWN]]; (* fh[k] is either floor(H(k)) or UNKNOWN *)
    f[n_] := k /. FindRoot[HarmonicNumber[k] == n, {k, Exp[n]}, WorkingPrecision -> 100] // Ceiling; f[0] = 1; Array[f, 28, 0] (* Robert G. Wilson v, Jan 24 2017 after Jean-François Alcover in A014537 *)
  • PARI
    a(n)=if(n,my(k=exp(n-Euler));ceil(solve(x=k-1.5,k+.5,intnum(y=0,1,(1-y^x)/(1-y))-n)),1) \\ Charles R Greathouse IV, Jun 13 2012
    

Formula

Note that the conditionally convergent series Sum_{k>=1} (-1)^(k+1)/k = log 2 (A002162).
Limit_{n->oo} a(n+1)/a(n) = e. - Robert G. Wilson v, Dec 07 2001
It is conjectured that, for n > 1, a(n) = floor(exp(n-gamma) + 1/2). - Benoit Cloitre, Oct 23 2002

Extensions

Terms for n >= 13 computed by Eric W. Weisstein; corrected by James R. Buddenhagen and Eric W. Weisstein, Feb 18 2001
Edited by Dean Hickerson, Apr 19 2003

A005228 Sequence and first differences (A030124) together list all positive numbers exactly once.

Original entry on oeis.org

1, 3, 7, 12, 18, 26, 35, 45, 56, 69, 83, 98, 114, 131, 150, 170, 191, 213, 236, 260, 285, 312, 340, 369, 399, 430, 462, 495, 529, 565, 602, 640, 679, 719, 760, 802, 845, 889, 935, 982, 1030, 1079, 1129, 1180, 1232, 1285, 1339, 1394, 1451, 1509, 1568, 1628, 1689
Offset: 1

Views

Author

Keywords

Comments

This is the lexicographically earliest sequence that together with its first differences (A030124) contains every positive integer exactly once.
Hofstadter introduces this sequence in his discussion of Scott Kim's "FIGURE-FIGURE" drawing. - N. J. A. Sloane, May 25 2013
A225850(a(n)) = 2*n-1, cf. A167151. - Reinhard Zumkeller, May 17 2013
In view of the definition of A075326: start with a(0) = 0, and extend by rule that the next term is the sum of the predecessor and the most recent non-member of the sequence. - Reinhard Zumkeller, Oct 26 2014

Examples

			Sequence reads 1 3 7 12 18 26 35 45..., differences are 2 4 5, 6, 8, 9, 10 ... and the point is that every number not in the sequence itself appears among the differences. This property (together with the fact that both the sequence and the sequence of first differences are increasing) defines the sequence!
		

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 73.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A030124 (complement), A037257, A056731, A056738, A140778, A225687.
Cf. A225850, A232746, A232747 (inverse), A232739, A232740, A232750 and also permutation pair A232751/A232752 constructed from this sequence and its complement.
Cf. A001651 (analog with sums instead of differences), A121229 (analog with products).
The same recurrence a(n) = a(n-1) + c(n-1) with different starting conditions: A061577 (starting with 2), A022935 (3), A022936 (4), A022937 (5), A022938 (6).
Related recurrences:
a(n-1) + c(n+1) - A022953, A022954.
a(n-1) + c(n) - A022946 to A022952.
a(n-1) + c(n-2) - A022940, A022941.
a(n-2) + c(n-1) - A022942 to A022944.
a(n-2) + c(n-2) - A022939.
a(n-3) + c(n-3) - A022955.
a(n-4) + c(n-4) - A022956.
a(n-5) + c(n-5) - A022957.

Programs

  • Haskell
    a005228 = scanl (+) 1 a030124
    a030124 = go 1 a005228 where go x ys | x < head ys = x     : go (x + 1) ys
                                         | otherwise   = x + 1 : go (x + 2) (tail ys)
    -- Maks Verver, Jun 30 2025
    
  • Maple
    maxn := 5000; h := array(1..5000); h[1] := 1; a := [1]; i := 1; b := []; for n from 2 to 1000 do if h[n] <> 1 then b := [op(b), n]; j := a[i]+n; if j < maxn then a := [op(a),j]; h[j] := 1; i := i+1; fi; fi; od: a; b; # a is A005228, b is A030124.
    A030124 := proc(n)
        option remember;
        local a,fnd,t ;
        if n <= 1 then
            op(n+1,[2,4]) ;
        else
            for a from procname(n-1)+1 do
                fnd := false;
                for t from 1 to n+1 do
                    if A005228(t)  = a then
                        fnd := true;
                        break;
                    end if;
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    A005228 := proc(n)
        option remember;
        if n <= 2 then
            op(n,[1,3]) ;
        else
            procname(n-1)+A030124(n-2) ;
        end if;
    end proc: # R. J. Mathar, May 19 2013
  • Mathematica
    a = {1}; d = 2; k = 1; Do[ While[ Position[a, d] != {}, d++ ]; k = k + d; d++; a = Append[a, k], {n, 1, 55} ]; a
    (* Second program: *)
    (* Program from Larry Morris, Jan 19 2017: *)
    d = 3; a = {1, 3, 7, 12, 18}; While[ Length[a = Join[a, a[[-1]] + Accumulate[Range[a[[d]] + 1, a[[++d]] - 1]]]] < 50]; a
    (* Comment: This adds as many terms to the sequence as there are numbers in each set of sequential differences. Consequently, the list of numbers it produces may be longer than the limit provided. With the limit of 50 shown, the sequence produced has length 60. *)
  • PARI
    A005228(n,print_all=0,s=1,used=0)={while(n--,used += 1<M. F. Hasler, Feb 05 2013

Formula

a(n) = a(n-1) + c(n-1) for n >= 2, where a(1)=1, a( ) increasing, c( ) = complement of a( ) (c is the sequence A030124).
Let a(n) = this sequence, b(n) = A030124 prefixed by 0. Then b(n) = mex{ a(i), b(i) : 0 <= i < n}, a(n) = a(n-1) + b(n) + 1. (Fraenkel)
a(1) = 1, a(2) = 3; a( ) increasing; for n >= 3, if a(q) = a(n-1)-a(n-2)+1 for some q < n then a(n) = a(n-1) + (a(n-1)-a(n-2)+2), otherwise a(n) = a(n-1) + (a(n-1)-a(n-2)+1). - Albert Neumueller (albert.neu(AT)gmail.com), Jul 29 2006
a(n) = n^2/2 + n^(3/2)/(3*sqrt(2)) + O(n^(5/4)) [proved in Jubin link]. - Benoit Jubin, May 13 2015
For all n >= 1, A232746(a(n)) = n and A232747(a(n)) = n. [Both sequences work as left inverses of this sequence.] - Antti Karttunen, May 14 2015

Extensions

Additional comments from Robert G. Wilson v, Oct 24 2001
Incorrect formula removed by Benoit Jubin, May 13 2015

A081145 a(1)=1; thereafter, a(n) is the least positive integer which has not already occurred and is such that |a(n)-a(n-1)| is different from any |a(k)-a(k-1)| which has already occurred.

Original entry on oeis.org

1, 2, 4, 7, 3, 8, 14, 5, 12, 20, 6, 16, 27, 9, 21, 34, 10, 25, 41, 11, 28, 47, 13, 33, 54, 15, 37, 60, 17, 42, 68, 18, 45, 73, 19, 48, 79, 22, 55, 23, 58, 94, 24, 61, 99, 26, 66, 107, 29, 71, 115, 30, 75, 121, 31, 78, 126, 32, 81, 132, 35, 87, 140, 36, 91, 147, 38, 96, 155, 39
Offset: 1

Views

Author

Don Reble, Mar 08 2003

Keywords

Comments

The sequence is a permutation of the positive integers. The inverse is A081146.
Similar to A100707, except that when we subtract we use the largest possible k.
The 1977 paper of Slater and Velez proves that this sequence is a permutation of positive integers and conjectures that its absolute difference sequence (see A308007) is also a permutation. If we call this the "Slater-Velez permutation of the first kind", then they also constructed another permutation (the 2nd kind), for which they are able to prove that both the sequence (A129198) and its absolute difference (A129199) are true permutations. - Ferenc Adorjan, Apr 03 2007
The points appear to lie on three straight lines of slopes roughly 0.56, 1.40, 2.24 (click "graph", or see the Wilks link). I checked this for the first 10^6 terms using Allan Wilks's C program. See A308009-A308015 for further information about the three lines. - N. J. A. Sloane, May 14 2019

Examples

			a(4)=7 because the previous term is 4 and the differences |3-4|, |5-4| and |6-4| have already occurred.
After 7 we get 3 as the difference 4 has not occurred earlier. 5 follows 14 as the difference 9 has not occurred earlier.
		

Crossrefs

The sequence of differences is A099004 (see also A308007).
Similar to Murthy's sequence A093903, Cald's sequence (A006509) and Recamán's sequence A005132. See also A100707 (another version).
A308021 is an offspring of this sequence. - N. J. A. Sloane, May 13 2019
See A308009-A308015 for the lines that the points lie on.
A308172 gives smallest missing numbers.

Programs

  • Haskell
    import Data.List (delete)
    a081145 n = a081145_list !! (n-1)
    a081145_list = 1 : f 1 [2..] [] where
       f x vs ws = g vs where
         g (y:ys) = if z `elem` ws then g ys else y : f y (delete y vs) (z:ws)
                    where z = abs (x - y)
    -- Reinhard Zumkeller, Jul 02 2015
  • Mathematica
    f[s_] := Block[{d = Abs[Rest@s - Most@s], k = 1}, While[ MemberQ[d, Abs[k - Last@s]] || MemberQ[s, k], k++ ]; Append[s, k]]; NestList[s, {1}, 70] (* Robert G. Wilson v, Jun 09 2006 *)
    f[s_] := Block[{k = 1, d = Abs[Most@s - Rest@s], l = Last@s}, While[MemberQ[s, k] || MemberQ[d, Abs[l - k]], k++ ]; Append[s, k]]; Nest[f, {1}, 70] (* Robert G. Wilson v, Jun 13 2006 *)
  • PARI
    {SV_p1(n)=local(x,v=6,d=2,j,k); /* Slater-Velez permutation - the first kind (by F. Adorjan)*/ x=vector(n);x[1]=1;x[2]=2; for(i=3,n,j=3;k=1;while(k,if(k=bittest(v,j)||bittest(d,abs(j-x[i-1])),j++,v+=2^j;d+=2^abs(j-x[i-1]);x[i]=j))); return(x)} \\ Ferenc Adorjan, Apr 03 2007
    
  • Python
    A081145_list, l, s, b1, b2 = [1,2], 2, 3, set(), set([1])
    for n in range(3, 10**2):
        i = s
        while True:
            m = abs(i-l)
            if not (i in b1 or m in b2):
                A081145_list.append(i)
                b1.add(i)
                b2.add(m)
                l = i
                while s in b1:
                    b1.remove(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 15 2014
    

A030124 Complement (and also first differences) of Hofstadter's sequence A005228.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78
Offset: 1

Views

Author

Keywords

Comments

For any n, all integers k satisfying sum(i=1,n,a(i))+1Benoit Cloitre, Apr 01 2002
The asymptotic equivalence a(n) ~ n follows from the fact that the values disallowed in the present sequence because they occur in A005228 are negligible, since A005228 grows much faster than A030124. The next-to-leading term in the formula is calculated from the functional equation F(x) + G(x) = x, suggested by D. Wilson (cf. reference), where F and G are the inverse functions of smooth, increasing approximations f and f' of A005228 and A030124. It seems that higher order corrections calculated from this equation do not agree with the real behavior of a(n). - M. F. Hasler, Jun 04 2008
A225850(a(n)) = 2*n, cf. A167151. - Reinhard Zumkeller, May 17 2013

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
  • D. R. Hofstadter, "Gödel, Escher, Bach: An Eternal Golden Braid", Basic Books, 1st & 20th anniv. edition (1979 & 1999), p. 73.

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a030124 n = a030124_list !! n
    a030124_list = figureDiff 1 [2..] where
       figureDiff n (x:xs) = x : figureDiff n' (delete n' xs) where n' = n + x
    -- Reinhard Zumkeller, Mar 03 2011
  • Mathematica
    (* h stands for Hofstadter's sequence A005228 *) h[1] = 1; h[2] = 3; h[n_] := h[n] = 2*h[n-1] - h[n-2] + If[ MemberQ[ Array[h, n-1], h[n-1] - h[n-2] + 1], 2, 1]; Differences[ Array[h, 69]] (* Jean-François Alcover, Oct 06 2011 *)
  • PARI
    {a=b=t=1;for(i=1,100, while(bittest(t,b++),); print1(b",");t+=1<M. F. Hasler, Jun 04 2008
    

Formula

a(n) = n + sqrt(2n) + o(n^(1/2)). - M. F. Hasler, Jun 04 2008 [proved in Jubin's paper].

Extensions

Changed offset to agree with that of A005228. - N. J. A. Sloane, May 19 2013
Showing 1-10 of 19 results. Next