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.

A348074 a(n) = A035327(n) if n is even, 3n + 1 if n is odd.

Original entry on oeis.org

1, 4, 1, 10, 3, 16, 1, 22, 7, 28, 5, 34, 3, 40, 1, 46, 15, 52, 13, 58, 11, 64, 9, 70, 7, 76, 5, 82, 3, 88, 1, 94, 31, 100, 29, 106, 27, 112, 25, 118, 23, 124, 21, 130, 19, 136, 17, 142, 15, 148, 13, 154, 11, 160, 9, 166, 7, 172, 5, 178, 3, 184, 1, 190, 63
Offset: 0

Views

Author

Keywords

Examples

			n    parity   function       a(n)
=    =====    =========     ======
0     even    A035327(0)      1
1     odd      3*1 + 1        4
2     even    A035327(2)      1
3     odd      3*3 + 1       10
4     even    A035327(4)      3
5     odd      3*5 + 1       16
		

Crossrefs

Programs

  • Python
    def A348074(n):
        if n%2==0:
            if n==0: return 1
            else: return (1<A035327(n)
        else: return 3*n+1
    
  • Python
    def A348074(n): return 3*n+1 if n&1 or n==0 else (~n)^(-1<Chai Wah Wu, Dec 20 2022