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

A181663 a(n) = A105801(n) mod 2.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1
Offset: 1

Views

Author

N. J. A. Sloane, Nov 20 2010

Keywords

Crossrefs

A122524 Prime numbers in Fibonacci-Collatz sequence A105801.

Original entry on oeis.org

2, 7, 103, 274309092506641744944619304235289, 71913864933263337464162651213311153, 23583673968885646741228783732071635618505511
Offset: 1

Views

Author

Zak Seidov, Sep 17 2006

Keywords

Crossrefs

Cf. A105801.

A124139 a(n) = A000265(3*(a(n-1) + a(n-2))/2 + 1) starting at a(1)=1, a(2)=11.

Original entry on oeis.org

1, 11, 19, 23, 1, 37, 29, 25, 41, 25, 25, 19, 67, 65, 199, 397, 895, 1939, 1063, 563, 305, 1303, 2413, 5575, 11983, 13169, 37729, 19087, 85225, 156469, 181271, 506611, 64489, 856651, 1381711, 419693, 2702107, 4682701, 11077213, 369373, 2146235, 3773413
Offset: 1

Views

Author

Yasutoshi Kohmoto, Dec 01 2006

Keywords

Comments

A variant of A105801: The highest power of two is recursively removed from 3x/2+1, where x is the sum of the preceding two elements of the sequence.

Crossrefs

Cf. A124138.

Programs

  • Maple
    A000265 := proc(n) local a,nshft ; a := 1 ; nshft := n ; while nshft mod 2 = 0 do nshft := nshft/2 ; od: nshft ; end:
    A124139 := proc(n) option remember ; if n = 1 then 1; elif n = 2 then 11; else A000265(3*(procname(n-1)+procname(n-2))/2 +1) ; fi; end: seq(A124139(n),n=1..60) ; # R. J. Mathar, Jul 02 2009

Extensions

Edited and extended by R. J. Mathar, Jul 02 2009

A181717 Fibonacci-Collatz sequence: a(1)=0, a(2)=1; for n>2, let fib=a(n-1)+a(n-2); if fib is odd then a(n)=3*fib+1 else a(n)=fib/2.

Original entry on oeis.org

0, 1, 4, 16, 10, 13, 70, 250, 160, 205, 1096, 3904, 2500, 3202, 2851, 18160, 63034, 40597, 310894, 1054474, 682684, 868579, 4653790, 16567108, 10610449, 81532672, 276429364, 178981018, 227705191, 1220058628, 4343291458, 2781675043, 21374899504, 72469723642
Offset: 1

Views

Author

Ralf Stephan, Nov 17 2010

Keywords

Comments

It is easy to prove that all the terms a(n) with n>=7 are congruent to 7 mod 9. Conjecture: for every k>0 there is an index m such that all the a(n) with n>m have the same residue mod 3^k. - Giovanni Resta, Nov 17 2010

Crossrefs

Programs

  • Haskell
    a181717 n = a181717_list !! (n-1)
    a181717_list = 0 : 1 : fc 1 0 where
       fc x x' = y : fc y x where y = a006370 (x + x')
    -- Reinhard Zumkeller, Oct 09 2011
    
  • Maple
    a:= proc(n) option remember; local f;
          if n<3 then return n-1 fi;
          f:= a(n-1) +a(n-2);
          `if`(irem(f, 2)=0, f/2, 3*f+1)
        end:
    seq(a(n), n=1..50); # Alois P. Heinz, Oct 09 2011
  • Mathematica
    nxt[{a_,b_}]:=Module[{fib=a+b},If[OddQ[fib],{b,3fib+1},{b,fib/2}]]; Transpose[NestList[nxt,{0,1},40]][[1]] (* Harvey P. Dale, Mar 21 2012 *)
  • PARI
    v=vector(60,n,0); v[2]=1; for(n=3,60,f=v[n-1]+v[n-2]; v[n]=if(f%2,3*f+1,f/2))
    
  • SageMath
    @CachedFunction
    def a(n):
        if n<3: return n-1
        elif (a(n-1)+a(n-2))%2==1: return 3*(a(n-1)+a(n-2))+1
        else: return (a(n-1)+a(n-2))/2
    [a(n) for n in range(1,51)] # G. C. Greubel, Mar 25 2024

A124138 a(n)= A000265(3*(a(n-1)+a(n-2))/2 +1) starting at a(1)=1, a(2)=3.

Original entry on oeis.org

1, 3, 7, 1, 13, 11, 37, 73, 83, 235, 239, 89, 493, 437, 349, 295, 967, 947, 359, 245, 907, 1729, 3955, 8527, 4681, 19813, 18371, 57277, 113473, 128063, 362305, 735553, 411697, 430219, 1262875, 1269821, 3799045, 1900825, 4274903, 9263593, 20307745, 2772313
Offset: 1

Views

Author

Yasutoshi Kohmoto, Dec 01 2006

Keywords

Comments

A variant of A105801: The highest power of two is recursively removed from 3x/2+1, where x is the sum of the preceding two elements of the sequence.

Examples

			Examples which start with s(1)=1 and s(2)=2*k+1:
1,1,1,1,1,1,1,1,1,1,1,1,..... : A000012
1,3,7,1,13,11,37,73,83,235,.... : this sequence
1,5,5,1,5,5,1,5,5,1,5,5,1,5,5,1,5,5,1,5,5.... : periodic
1,7,13,31,67,37,157,73,173,185,269,341,229,107,505,919,2137,4585,....
1,9,1,1,1,1,1,1,1,1,1.1....
1,11,19,23,1,37,29,25,41,25,25,19,67,65,199,397,895,.... : A124139
		

Extensions

Edited and extended by R. J. Mathar, Jul 02 2009

A329068 a(1) = 1; thereafter if the sum of digits of all previous terms up to a(n) is even then a(n+1) = (sum of digits of all previous terms)/2, otherwise a(n+1) = (sum of digits of all previous terms)*3 + 1.

Original entry on oeis.org

1, 4, 16, 6, 9, 82, 112, 124, 24, 27, 190, 220, 232, 42, 45, 298, 59, 66, 72, 460, 490, 88, 96, 622, 652, 115, 712, 742, 130, 132, 135, 838, 149, 156, 162, 1000, 167, 174, 180, 1108, 1138, 196, 204, 207, 1270, 1300, 1312, 222, 225, 1378, 239, 246, 252, 1540, 1570, 268, 276
Offset: 1

Views

Author

Bence BernĂ¡th, Nov 03 2019

Keywords

Crossrefs

Programs

  • MATLAB
    clear all;
    length_seq=10000;
    sequence(1)=1;
    seq_for_digits(1)=sequence(1);
    for i1=1:1:length_seq
       if  0==mod(sum(seq_for_digits),2)
            sequence(i1+1)=sum(seq_for_digits)/2;
       else
         sequence(i1+1)=sum(seq_for_digits)*3+1;
       end
         append=num2str(sequence(i1+1))-'0';
         seq_for_digits=[seq_for_digits append];
    end
    result=transpose(sequence);
    
  • PARI
    lista(nn) = {va = vector(nn); va[1] = 1; sd = sumdigits(va[1]); for (n=2, nn, if (sd % 2, va[n] = 3*sd+1, va[n] = sd/2); sd += sumdigits(va[n]);); va;} \\ Michel Marcus, Nov 04 2019
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        sd, an = 0, 1
        while True:
            yield an
            sd += sum(map(int, str(an)))
            an = 3*sd+1 if sd&1 else sd//2
    print(list(islice(agen(), 60))) # Michael S. Branicky, Nov 12 2022
Showing 1-6 of 6 results.