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-5 of 5 results.

A185038 Positions at which A090895 (a(1) = 1 then a(n) = a(n-1)/2 if a(n-1) is even, a(n) = a(n-1) + n otherwise) reach the value of 1.

Original entry on oeis.org

1, 8, 15, 64, 7069, 229826, 62906548, 104509874538, 209233407362, 474536678820, 2653613575299, 14802269029898
Offset: 1

Views

Author

Sergio Pimentel, Mar 01 2012

Keywords

Comments

It seems that this sequence is infinite.

Examples

			Example: the sequence a(1)=1 then a(n)=a(n-1)/2 if a(n-1) is even, a(n) = a(n-1) + n otherwise goes 1, 3, 6, 3, 8, 4, 2, 1, 10, 5, 16, 8, 4, 2, 1, etc... which has ones at 1, 8, 15, 64, etc...
		

Crossrefs

Cf. A090895.

Programs

  • Haskell
    import Data.List (elemIndices)
    a185038 n = a185038_list !! (n-1)
    a185038_list = map (+ 1) $ elemIndices 1 a090895_list
    -- Reinhard Zumkeller, Mar 02 2012

Extensions

a(8)-a(12) from Hiroaki Yamanouchi, Oct 04 2014

A208852 Smallest m such that A090895(m) = n.

Original entry on oeis.org

1, 7, 2, 6, 10, 3, 48, 5, 21, 9, 44, 81, 27, 47, 55, 11, 16, 20, 1058, 364, 745, 43, 300, 80, 69, 26, 24, 46, 5901, 54, 22, 59, 32, 17, 30, 19, 568076, 1057, 75, 363, 28, 744, 87, 42, 169, 299, 40, 79, 315, 68, 186, 25, 101, 23, 38, 45, 2924, 5900, 413, 53
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 02 2012

Keywords

Comments

A090895(a(n)) = n and A090895(m) <> n for m < a(n).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a208852 = (+ 1) . fromJust . (`elemIndex` a090895_list)

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

A208884 a(n) = (a(n-1) + n)/2^k where 2^k is the largest power of 2 dividing a(n-1) + n, for n>1 with a(1)=1.

Original entry on oeis.org

1, 3, 3, 7, 3, 9, 1, 9, 9, 19, 15, 27, 5, 19, 17, 33, 25, 43, 31, 51, 9, 31, 27, 51, 19, 45, 9, 37, 33, 63, 47, 79, 7, 41, 19, 55, 23, 61, 25, 65, 53, 95, 69, 113, 79, 125, 43, 91, 35, 85, 17, 69, 61, 115, 85, 141, 99, 157, 27, 87, 37, 99, 81, 145, 105, 171
Offset: 1

Views

Author

Paul D. Hanna, Mar 02 2012

Keywords

Comments

In other words, to get a(n), add n to a(n-1) and compute the odd part (A000265) of the sum. - Ralf Stephan, Oct 27 2013
POSITIONS of odd numbers in the initial 7000000 terms begin:
1: [1, 7, 69, 285, 3601, 5167, 92989, 112651, 6933175, ...];
3: [2, 3, 5, 613, 8461, 46749, 81237, 102171, 126661, 3309589, ...];
5: [13, 97, 2431, 92095, ...];
7: [4, 33, 3167, 78095, 2723179, ...];
9: [6, 8, 9, 21, 27, 303, 2017, 3239, 3765, 6753, 28387, 251451, ...];
11: [75, 15823, 28221, 4091959, 5820487, ...];
13: [22975, 42391, 3729249, ...];
15: [11, 22587, 2527579, 6954893, ...];
17: [15, 51, 3121, 13433, 74763, 376853, 576439, 896899, ...];
19: [10, 14, 25, 35, 291, 77747, 757319, 1227595, 2307099, ...];
21: [1417, 1557, 712229, 2563807, ...];
23: [37, 127, 609, 2211, 5563, 199901, ...];
25: [17, 39, 221, 1145, 3425, 17593, 4318897, ...];
27: [12, 23, 59, 73, 289, 1149, 3393, 20439, 37107, ...];
29: [573, 33315, 61505, 467047, 491359, 1170709, 1492309, 2498593, 3017011, ...];
31: [19, 22, 229, 409, 6199, 60529, 3602675, 4108215, 4604929, ...]; ...
From Ya-Ping Lu, Jun 25 2020: (Start)
Conjecture: For any given odd number m, there exists a number n_max such that all odd numbers <= m can be found in the sequence a(n) with n <= n_max. For example:
m = 1, n_max = 1;
m = 3, n_max = 2;
m = 5, n_max = 13;
m = 11, n_max = 75
m = 13, n_max = 22975;
m = 305, n_max = 1025715;
m = 749, n_max = 14695985;
m = 795, n_max = 150788015;
m = 7525, n_max = 31129547917;
...
If the conjecture above is true, this sequence contains all odd numbers. (End)

Examples

			a(2) = 1 + 2 = 3;
a(3) = (3 + 3)/2 = 3;
a(4) = 3 + 4 = 7;
a(5) = (7 + 5)/4 = 3;
a(6) = 3 + 6 = 9;
a(7) = (9 + 7)/16 = 1; ...
		

Crossrefs

Programs

  • Mathematica
    a[1]=1; a[n_] := a[n] = #/2^IntegerExponent[#, 2] &@ (n + a[n-1]); Array[a, 70] (* Giovanni Resta, Jun 25 2020 *)
  • PARI
    {a(n)=if(n==1, 1, (a(n-1)+n)/2^valuation(a(n-1)+n,2))}
    
  • PARI
    {A=vector(1024); a(n)=A[n]=if(n==1, 1, (A[n-1]+n)/2^valuation(A[n-1]+n,2))}
    for(n=1,#A,print1(a(n),", "))

A345877 a(1) = 1, a(n) = a(n-1)/2 if a(n-1) is even, otherwise a(n) = n - a(n-1).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 1, 7, 2, 1, 10, 5, 8, 4, 2, 1, 16, 8, 4, 2, 1, 21, 2, 1, 24, 12, 6, 3, 26, 13, 18, 9, 24, 12, 6, 3, 34, 17, 22, 11, 30, 15, 28, 14, 7, 39, 8, 4, 2, 1, 50, 25, 28, 14, 7, 49, 8, 4, 2, 1, 60, 30, 15, 49, 16, 8, 4, 2, 1, 69, 2, 1, 72, 36, 18, 9, 68, 34, 17, 63, 18, 9, 74, 37, 48, 24, 12, 6, 3
Offset: 1

Views

Author

Altug Alkan, Jun 28 2021

Keywords

Comments

Let a_i(1) = 1 and a_i(n) = a_i(n-1)/(i+1) if a_i(n-1) is divisible by i+1, otherwise a_i(n) = n - a_i(n-1). This sequence is a_1(n) and A345886 is a_2(n).
Conjecture: a_i(n) hits every positive integers infinitely many times for all i >= 1.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = If[EvenQ[a[n - 1]], a[n - 1]/2, n - a[n - 1]]; Array[a, 100] (* Amiram Eldar, Jun 29 2021 *)
    nxt[{n_,a_}]:={n+1,If[EvenQ[a],a/2,n+1-a]}; NestList[nxt,{1,1},90][[;;,2]] (* Harvey P. Dale, Aug 31 2023 *)
  • PARI
    q=vector(100); q[1]=1; for(n=2, #q, q[n] = if(q[n-1]%2, n-q[n-1], q[n-1]/2)); q
Showing 1-5 of 5 results.