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 28 results. Next

A337486 Numbers k such that b(k+1) divides b(k), where b() is Recamán's multiplicative sequence A008336.

Original entry on oeis.org

1, 6, 10, 12, 14, 18, 20, 22, 26, 28, 30, 34, 36, 38, 42, 44, 45, 46, 50, 52, 54, 58, 60, 66, 68, 70, 72, 78, 82, 84, 86, 90, 92, 93, 94, 95, 98, 99, 100, 104, 106, 110, 111, 114, 116, 118, 119, 122, 124, 126, 130, 132, 134, 135, 136, 142, 146, 147, 148, 150, 154, 156, 158, 161, 162, 164, 165, 166
Offset: 1

Views

Author

Scott R. Shannon, Aug 29 2020

Keywords

Comments

The old definition was: 1, together with the numbers formed by removing the required prime factors to form the number from a set which is initially empty and that has primes added via the addition of the prime factors of numbers which cannot be created from those currently in the set. Start by trying to create the number 2.
Consider an initially empty set of primes whose numbers are used to create a given number where each time a number is created those prime factors are removed from the set. If a number cannot be created as all its required prime factors are not currently in the set then all the prime factors of that number are instead added to the set. Start by trying to create the number 2 followed by all other integers. This sequence list the numbers that are created.
For the first 1 million terms the largest gap between terms is 15, between a(88018) = 189648 and a(88019) = 189663. The 1 millionth term is created after the addition of the number 2123404. The prime set at that point has 114323 primes, with the maximum number of entries for a single prime being eleven, for 887.
Note that if after the creation of a number the entire set of primes is cleared then the numbers created are those in A109895.

Examples

			a(2) = 6. As there are no primes initially in the set 2,3,4,5 cannot be created and instead these numbers add three 2's, one 3 and one 5 to the set. As there is now one 2 and one 3 the number 6 = 2*3 can be created. After 6 is created the set of primes now contains 2,2,5.
a(3) = 10. After 7,8,9, none of which can be created from the prime set, the prime set contains 2,2,2,2,2,3,3,5,7. As 2 and 5 are present 10 = 2*5 can be created, after which the set contains 2,2,2,2,3,3,7.
		

Crossrefs

First differences are A370969.

Programs

  • Mathematica
    Block[{nn = 166, k = 1}, Reap[Do[If[Mod[k, i] == 0, k /= i; Sow[i], k *= i], {i, nn}]][[-1, 1]]] (* Michael De Vlieger, Sep 12 2020 *)
  • Python
    from itertools import count, islice
    def A337486_gen(): # generator of terms
        c = 1
        for n in count(1):
            a, b = divmod(c,n)
            if not b:
                c = a
                yield n
            else:
                c *= n
    A337486_list = list(islice(A337486_gen(),30)) # Chai Wah Wu, Apr 11 2024

A370968 A008336 sorted and duplicates removed.

Original entry on oeis.org

1, 2, 6, 20, 24, 120, 140, 858, 924, 1008, 1120, 10080, 11088, 12012, 12870, 176358, 184756, 194480, 205920, 3500640, 3695120, 3879876, 4056234, 87253605, 90262350, 93605400, 97349616, 2433740400, 2527345800, 2617608150, 2704861755, 57176602275, 79526843550, 81676217700, 84009823920, 86555576160, 2630123704650, 2687300306925, 2856334013280
Offset: 1

Views

Author

N. J. A. Sloane, Apr 11 2024

Keywords

Comments

In fact 1 is the only repeated term in A008336 (see that entry for proof).

Examples

			From _Michael De Vlieger_, Apr 11 2024: (Start)
Table of first terms showing exponents of prime factors p | a(n), with "." signifying p^0.
                 primes
                     1111
   n       a(n)  23571379
  -----------------------
   1         1   .
   2         2   1
   3         6   11
   4        20   2.1
   5        24   31
   6       120   311
   7       140   2.11
   8       858   11..11
   9       924   21.11
  10      1008   42.1
  11      1120   5.11
  12     10080   5211
  13     11088   42.11
  14     12012   21.111
  15     12870   121.11
  16    176358   11.1.111
  17    184756   2...1111
  18    194480   4.1.111
  19    205920   521.11
  20   3500640   521.111 (End)
		

Crossrefs

A371908 a(n) = 2-adic valuation of A008336(2*n).

Original entry on oeis.org

0, 1, 3, 2, 5, 4, 2, 1, 5, 4, 2, 1, 4, 3, 1, 0, 5, 4, 2, 1, 4, 3, 1, 0, 4, 3, 1, 0, 3, 2, 0, 1, 7, 6, 4, 3, 0, 1, 3, 2, 6, 5, 3, 2, 5, 4, 2, 1, 6, 5, 3, 4, 1, 0, 2, 1, 5, 4, 2, 1, 4, 3, 1, 0, 7, 6, 4, 3, 0, 1, 3, 2, 6, 5, 3, 2, 5, 4, 2, 1, 6, 5, 3, 2, 5, 4, 2
Offset: 1

Views

Author

Michael De Vlieger, Apr 11 2024

Keywords

Comments

Aside from initial 0, first 50 terms agree with A371905: A371905(50) = 3 while a(51) = 5.

Examples

			Let b(n) = A008336(n) and let f(x) = A007814(x).
a(1) = 0 since b(2*1) = 1 and f(b(2)) = 0.
a(2) = 1 since b(2*2) = 6 and f(b(4)) = 1.
a(3) = 3 since b(2*3) = 120 and f(b(6)) = 3, etc.
		

Crossrefs

Programs

  • Mathematica
    k = 1; nn = 240; p[_] := 0; r = 0; q = Prime[k];
    {0}~Join~Reap[
        Do[If[AnyTrue[#, p[#1] < #2 & @@ # &],
            Map[p[#1] += #2 & @@ # &, #],
            Map[p[#1] -= #2 & @@ # &, #] ] &@
            Map[{PrimePi[#1], #2} & @@ # &, FactorInteger[n]];
          If[Divisible[n, q], Sow[p[k] ] ], {n, nn}] ][[-1, 1]]
  • Python
    from itertools import count, islice
    def A371908_gen(): # generator of terms
        m = 1
        for n in count(1,2):
            a, b = divmod(m,n)
            m = m*n if b else a
            yield (~m&m-1).bit_length()
            a, b = divmod(m,n+1)
            m = m*(n+1) if b else a
    A371908_list = list(islice(A371908_gen(),20)) # Chai Wah Wu, Apr 15 2024

Formula

a(n) = A007814(A008336(2*n)).

A372095 a(n) = 3-adic valuation of A008336(3*n).

Original entry on oeis.org

0, 1, 0, 2, 1, 2, 0, 1, 2, 5, 4, 5, 3, 4, 3, 1, 2, 3, 0, 1, 0, 2, 1, 2, 0, 1, 0, 4, 3, 4, 2, 1, 2, 0, 1, 2, 5, 4, 3, 5, 6, 7, 5, 6, 5, 2, 3, 4, 6, 5, 4, 6, 5, 6, 2, 1, 2, 0, 1, 2, 0, 1, 0, 3, 4, 5, 3, 4, 3, 5, 4, 5, 2, 3, 2, 0, 1, 0, 2, 3, 4, 9, 8, 9, 7, 8, 7
Offset: 1

Views

Author

Michael De Vlieger, Jun 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    k = 2; nn = 360; p[_] := 0; r = 0; q = Prime[k];
    {0}~Join~Reap[
       Do[If[AnyTrue[#, p[#1] < #2 & @@ # &],
            Map[p[#1] += #2 & @@ # &, #],
            Map[p[#1] -= #2 & @@ # &, #] ] &@
            Map[{PrimePi[#1], #2} & @@ # &, FactorInteger[n]];
          If[Divisible[n, q], Sow[p[k] ] ], {n, nn}] ][[-1, 1]]

Formula

a(n) = A007949(A008336(3*n)).

A372840 a(n) = 5-adic valuation of A008336(5*n).

Original entry on oeis.org

0, 1, 0, 1, 0, 2, 1, 2, 3, 2, 0, 1, 0, 1, 0, 2, 3, 4, 3, 2, 0, 1, 0, 1, 2, 5, 4, 3, 4, 5, 3, 4, 5, 4, 3, 1, 0, 1, 0, 1, 3, 4, 3, 4, 5, 3, 2, 1, 2, 3, 0, 1, 0, 1, 0, 2, 3, 4, 3, 4, 2, 3, 2, 3, 4, 2, 1, 0, 1, 2, 0, 1, 0, 1, 0, 3, 4, 3, 2, 1, 3, 2, 1, 0, 1, 3, 2
Offset: 1

Views

Author

Michael De Vlieger, Jun 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    k = 3; nn = 600; p[_] := 0; r = 0; q = Prime[k];
    {0}~Join~Reap[
        Do[If[AnyTrue[#, p[#1] < #2 & @@ # &],
            Map[p[#1] += #2 & @@ # &, #],
            Map[p[#1] -= #2 & @@ # &, #] ] &@
            Map[{PrimePi[#1], #2} & @@ # &, FactorInteger[n]];
          If[Divisible[n, q], Sow[p[k] ] ], {n, nn}] ][[-1, 1]]

Formula

a(n) = A112765(A008336(5*n)).

A195504 Product of numbers up to n-1 used as divisors in A008336(n), n >= 2; a(1) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 6, 6, 6, 6, 60, 60, 720, 720, 10080, 10080, 10080, 10080, 181440, 181440, 3628800, 3628800, 79833600, 79833600, 79833600, 79833600, 2075673600, 2075673600, 58118860800, 58118860800, 1743565824000, 1743565824000, 1743565824000, 1743565824000
Offset: 1

Views

Author

Daniel Forgues, Sep 19 2011

Keywords

Comments

This sequence provides more insight into the asymptotic behavior of log(A008336(n)). - Daniel Forgues, Sep 21 2011

Crossrefs

Programs

  • Maple
    A008336 := proc(n) option remember; if(n=1)then 1: elif(procname(n-1) mod (n-1)=0)then procname(n-1)/(n-1): else procname(n-1)*(n-1): fi: end: A195504 := proc(n) option remember: if(n=1)then 1: elif(A008336(n)<A008336(n-1))then (n-1)*procname(n-1): else procname(n-1): fi: end: seq(A195504(n),n=1..40); # Nathaniel Johnston, Sep 29 2011

Formula

Sqrt((n-1)! / A008336(n)), n >= 1.

A369407 A variant of A008336 based on polynomials over GF(2) (see Comments for precise definition).

Original entry on oeis.org

1, 2, 6, 24, 120, 20, 108, 864, 96, 960, 6720, 624, 6192, 37152, 491232, 30702, 1806, 127, 1905, 27348, 486596, 25102, 1890, 19760, 456624, 5581280, 439712, 21624, 451032, 5199760, 123954032, 3966529024, 123317760, 3850804224, 127210628096, 4070965504
Offset: 1

Views

Author

Rémy Sigrist, Jan 22 2024

Keywords

Comments

Let P(m) denote the polynomial over GF(2) whose coefficients are encoded in the binary expansion of the nonnegative integer m.
Let b(1) = 1 and for any n > 0, if P(n) divides b(n) then b(n+1) = b(n) / P(n), otherwise b(n+1) = b(n) * P(n).
For any n > 0, a(n) is the unique number v such that P(v) = b(n).

Examples

			The first terms, alongside the corresponding polynomials, are:
  n   a(n)  b(n)                   P(n)
  --  ----  ---------------------  -----------
   1     1  1                      1
   2     2  X                      X
   3     6  X^2 + X                X + 1
   4    24  X^4 + X^3              X^2
   5   120  X^6 + X^5 + X^4 + X^3  X^2 + 1
   6    20  X^4 + X^2              X^2 + X
   7   108  X^6 + X^5 + X^3 + X^2  X^2 + X + 1
   8   864  X^9 + X^8 + X^6 + X^5  X^3
   9    96  X^6 + X^5              X^3 + 1
  10   960  X^9 + X^8 + X^7 + X^6  X^3 + X
		

Crossrefs

Cf. A008336.

Programs

  • PARI
    P(n) = Mod(1, 2) * Pol(binary(n))
    P_1(p) = fromdigits(lift(Vec(p)), 2)
    { b = 1; for (n = 1, 36, p = P(n); if (b % p==0, b \= p, b *= p); print1 (P_1(b)", ");); }

A370971 A008336(n) is divisible by the product of the primes p such that n/2 <= p < n; a(n) is the quotient.

Original entry on oeis.org

1, 1, 1, 1, 8, 8, 4, 4, 32, 288, 144, 144, 12, 12, 6, 90, 1440, 1440, 80, 80, 4, 84, 42, 42, 1008, 25200, 12600, 340200, 12150, 12150, 405, 405, 12960, 427680, 213840, 7484400, 207900, 207900, 103950, 4054050, 162162000, 162162000, 3861000, 3861000, 87750, 1950, 975, 975, 46800, 2293200, 45864, 2339064, 44982
Offset: 1

Views

Author

N. J. A. Sloane, Apr 13 2024

Keywords

Examples

			For n= 7, A008336(7) = 20. The only prime with 3.5 <= p < 7 is 5, so a(7) = 20/5 = 4.
For n= 8, A008336(7) = 140. The only primes with 4 <= p < 8 are 5 and 7, so a(8) = 140/(5*7) = 4.
		

Crossrefs

Cf. A008336, A055773 (note that A055773 has offset 0).

Formula

a(n) = A008336(n)/A055773(n-1).

A005132 Recamán's sequence (or Recaman's sequence): a(0) = 0; for n > 0, a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 42, 17, 43, 16, 44, 15, 45, 14, 46, 79, 113, 78, 114, 77, 39, 78, 38, 79, 37, 80, 36, 81, 35, 82, 34, 83, 33, 84, 32, 85, 31, 86, 30, 87, 29, 88, 28, 89, 27, 90, 26, 91, 157, 224, 156, 225, 155
Offset: 0

Views

Author

N. J. A. Sloane and Simon Plouffe, May 16 1991

Keywords

Comments

The name "Recamán's sequence" is due to N. J. A. Sloane, not the author!
I conjecture that every number eventually appears - see A057167, A064227, A064228. - N. J. A. Sloane. That was written in 1991. Today I'm not so sure that every number appears. - N. J. A. Sloane, Feb 26 2017
As of Jan 25 2018, the first 13 missing numbers are 852655, 930058, 930557, 964420, 966052, 966727, 969194, 971330, 971626, 971866, 972275, 972827, 976367, ... For further information see the "Status Report" link. - Benjamin Chaffin, Jan 25 2018
From David W. Wilson, Jul 13 2009: (Start)
The sequence satisfies [1] a(n) >= 0, [2] |a(n)-a(n-1)| = n, and tries to avoid repeats by greedy choice of a(n) = a(n-1) -+ n.
This "wants" to be an injection on N = {0, 1, 2, ...}, as it attempts to avoid repeats by choice of a(n) = a(n-1) + n when a(n) = a(n-1) - n is a repeat.
Clearly, there are injections satisfying [1] and [2], e.g., a(n) = n(n+1)/2.
Is there a lexicographically earliest injection satisfying [1] and [2]? (End)
Answer: Yes, of course: The set of injections satisfying [1] and [2] is not empty, so there's a lexicographically least element. More concretely, it starts with the same 23 terms a(0..22) which are known to be minimal, but after a(22) = 41 it has to go on with a(23) = 41 + 23 = 64, since choosing "-" here necessarily yields a non-injective sequence. See A171884. - M. F. Hasler, Apr 01 2019
It appears that a(n) is also the value of "x" and "y" of the endpoint of the L-toothpick structure mentioned in A210606 after n-th stage. - Omar E. Pol, Mar 24 2012
Of course this is not a permutation of the integers: the first repeated term is 42 = a(24) = a(20). - M. F. Hasler, Nov 03 2014. Also 43 = a(18) = a(26). - Jon Perry, Nov 06 2014
Of all the sequences in the OEIS, this one is my favorite to listen to. Click the "listen" button at the top, set the instrument to "103. FX 7 (Echoes)", click "Save", and open the MIDI file with a program like QuickTime Player 7. - N. J. A. Sloane, Aug 08 2017
This sequence cycles clockwise around the OEIS logo. - Ryan Brooks, May 09 2020

Examples

			Consider n=6. We have a(5)=7 and try to subtract 6. The result, 1, is certainly positive, but we cannot use it because 1 is already in the sequence. So we must add 6 instead, getting a(6) = 7 + 6 = 13.
		

References

  • Alex Bellos and Edmund Harriss, Visions of the Universe (2016), Unnumbered pages. Includes Harriss's illustration of the first 65 steps drawn as a spiral.
  • Benjamin Chaffin, N. J. A. Sloane, and Allan Wilks, On sequences of Recaman type, paper in preparation, 2006.
  • Bernardo Recamán Santos, letter to N. J. A. Sloane, Jan 29 1991
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A057165 (addition steps), A057166 (subtraction steps), A057167 (steps to hit n), A008336, A046901 (simplified version), A064227 (records for reaching n), A064228 (value of n that take a record number of steps to reach), A064284 (no. of times n appears), A064290 (heights of terms), A064291 (record highs), A119632 (condensed version), A063733, A079053, A064288, A064289, A064387, A064388, A064389, A228474 (bidirectional version).
A065056 gives partial sums, A160356 gives first differences.
A row of A066201.
Cf. A171884 (injective variant).
See A324784, A324785, A324786 for the "low points".

Programs

  • Haskell
    import Data.Set (Set, singleton, notMember, insert)
    a005132 n = a005132_list !! n
    a005132_list = 0 : recaman (singleton 0) 1 0 where
       recaman :: Set Integer -> Integer -> Integer -> [Integer]
       recaman s n x = if x > n && (x - n) `notMember` s
                          then (x-n) : recaman (insert (x-n) s) (n+1) (x-n)
                          else (x+n) : recaman (insert (x+n) s) (n+1) (x+n)
    -- Reinhard Zumkeller, Mar 14 2011
    
  • MATLAB
    function a=A005132(m)
    % m=max number of terms in a(n). Offset n:0
    a=zeros(1,m);
    for n=2:m
        B=a(n-1)-(n-1);
        C=0.^( abs(B+1) + (B+1) );
        D=ismember(B,a(1:n-1));
        a(n)=a(n-1)+ (n-1) * (-1)^(C + D -1);
    end
    % Adriano Caroli, Dec 26 2010
    
  • Maple
    h := array(1..100000); maxt := 100000; a := [1]; ad := [1]; su := []; h[1] := 1; for nx from 2 to 500 do t1 := a[nx-1]-nx; if t1>0 and h[t1] <> 1 then su := [op(su), nx]; else t1 := a[nx-1]+nx; ad := [op(ad), nx]; fi; a := [op(a),t1]; if t1 <= maxt then h[t1] := 1; fi; od: # a is A005132, ad is A057165, su is A057166
    A005132 := proc(n)
        option remember; local a, found, j;
        if n = 0 then return 0 fi;
        a := procname(n-1) - n ;
        if a <= 0 then return a+2*n fi;
        found := false;
        for j from 0 to n-1 while not found do
            found := procname(j) = a;
        od;
        if found then a+2*n else a fi;
    end:
    seq(A005132(n), n=0..70); # R. J. Mathar, Apr 01 2012 (reformatted by Peter Luschny, Jan 06 2019)
  • Mathematica
    a = {1}; Do[ If[ a[ [ -1 ] ] - n > 0 && Position[ a, a[ [ -1 ] ] - n ] == {}, a = Append[ a, a[ [ -1 ] ] - n ], a = Append[ a, a[ [ -1 ] ] + n ] ], {n, 2, 70} ]; a
    (* Second program: *)
    f[s_List] := Block[{a = s[[ -1]], len = Length@s}, Append[s, If[a > len && !MemberQ[s, a - len], a - len, a + len]]]; Nest[f, {0}, 70] (* Robert G. Wilson v, May 01 2009 *)
    RecamanSeq[i_Integer] := Fold[With[{lst=Last@#, len=Length@#}, Append[#, If[lst > len && !MemberQ[#, lst - len], lst - len, lst + len]]] &, {0}, Range@i]; RecamanSeq[10^5] (* Mikk Heidemaa, Nov 02 2024 *)
  • PARI
    a(n)=if(n<2,1,if(abs(sign(a(n-1)-n)-1)+setsearch(Set(vector(n-1,i,a(i))),a(n-1)-n),a(n-1)+n,a(n-1)-n))  \\ Benoit Cloitre
    
  • PARI
    A005132(N=1000,show=0)={ my(s,t); for(n=1,N, s=bitor(s,1<M. F. Hasler, May 11 2008, updated M. F. Hasler, Nov 03 2014
    
  • Python
    l=[0]
    for n in range(1, 101):
        x=l[n - 1] - n
        if x>0 and not x in l: l+=[x, ]
        else: l+=[l[n - 1] + n]
    print(l) # Indranil Ghosh, Jun 01 2017
    
  • Python
    def recaman(n):
      seq = []
      for i in range(n):
        if(i == 0): x = 0
        else: x = seq[i-1]-i
        if(x>=0 and x not in seq): seq+=[x]
        else: seq+=[seq[i-1]+i]
      return seq
    print(recaman(1000)) # Ely Golden, Jun 14 2018
    
  • Python
    from itertools import count, islice
    def A005132_gen(): # generator of terms
        a, aset = 0, set()
        for n in count(1):
            yield a
            aset.add(a)
            a = b if (b:=a-n)>=0 and b not in aset else a+n
    A005132_list = list(islice(A005132_gen(),30)) # Chai Wah Wu, Sep 15 2022

Formula

a(k) = A000217(k) - 2*Sum_{i=1..n} A057166(i), for A057166(n) <= k < A057166(n+1). - Christopher Hohl, Jan 27 2019

Extensions

Allan Wilks, Nov 06 2001, computed 10^15 terms of this sequence. At this point all the numbers below 852655 had appeared, but 852655 = 5*31*5501 was missing.
After 10^25 terms of A005132 the smallest missing number is still 852655. - Benjamin Chaffin, Jun 13 2006
Even after 7.78*10^37 terms, the smallest missing number is still 852655. - Benjamin Chaffin, Mar 28 2008
Even after 4.28*10^73 terms, the smallest missing number is still 852655. - Benjamin Chaffin, Mar 22 2010
Even after 10^230 terms, the smallest missing number is still 852655. - Benjamin Chaffin, 2018
Changed "positive" in definition to "nonnegative". - N. J. A. Sloane, May 04 2020

A135287 a(0)=1; for n > 0, a(n) = a(n-1)+n if a(n-1) is odd, else a(n) = a(n-1)/2.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 7, 14, 7, 16, 8, 4, 2, 1, 15, 30, 15, 32, 16, 8, 4, 2, 1, 24, 12, 6, 3, 30, 15, 44, 22, 11, 43, 76, 38, 19, 55, 92, 46, 23, 63, 104, 52, 26, 13, 58, 29, 76, 38, 19, 69, 120, 60, 30, 15, 70, 35, 92, 46, 23, 83
Offset: 0

Views

Author

Ctibor O. Zizka, Dec 03 2007, Dec 05 2007

Keywords

Comments

Let a(0), C1, C2, C be integers. Consider the sequence a(n) = a(n-1) + C1*n + C2 if a(n-1) is not divisible by C or a(n) = a(n-1)/C otherwise.
For a fixed C1, C2, C this sequence shows chaotic behavior for some a(0) and a highly regular behavior for other a(0).
The parameter C1 tells how many regular subclasses are there.
The sequence grows roughly as a(n) ~ n*const.
Here C = 2. Other sequences showing very interesting behavior have C = power of 2.
Example: C1=3, C2=10, C=3. Thus a(n)= a(n-1)+3*n+10 if a(n-1) is not divisible by 3, or a(n)= a(n-1)/3 otherwise. There are 2 classes:
a regular class with 3 subclasses (C1=3) for initial values
{a(0)=3,38,79,...}
{a(0)=1,8,12,42,47,49,63,77,88,...}
{a(0)=2,43,45,...}
and a "chaotic" class for other initial values a(0).

Crossrefs

Programs

  • Haskell
    a135287 n = a135287_list !! n
    a135287_list = 1 : f 1 1 where
       f x y = z : f (x + 1) z where
            z = if m == 0 then y' else x + y; (y',m) = divMod y 2
    -- Reinhard Zumkeller, Mar 02 2012
  • Maple
    A135287 := proc(n) option remember ; if n = 0 then 1 ; elif A135287(n-1) mod 2 = 0 then A135287(n-1)/2 ; else n+A135287(n-1) ; fi ; end: seq(A135287(n),n=0..60) ; # R. J. Mathar, Dec 12 2007
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[OddQ[a],a+n+1,a/2]}; NestList[nxt,{0,1},60][[;;,2]] (* Harvey P. Dale, Mar 02 2023 *)

Extensions

More terms from R. J. Mathar, Dec 12 2007
Offset fixed by Reinhard Zumkeller, Mar 02 2012
Showing 1-10 of 28 results. Next