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.

A350034 a(n) = n/gcd(n,6) if gcd(n,6)>1, 5n + 1 otherwise.

Original entry on oeis.org

0, 6, 1, 1, 2, 26, 1, 36, 4, 3, 5, 56, 2, 66, 7, 5, 8, 86, 3, 96, 10, 7, 11, 116, 4, 126, 13, 9, 14, 146, 5, 156, 16, 11, 17, 176, 6, 186, 19, 13, 20, 206, 7, 216, 22, 15, 23, 236, 8, 246, 25, 17, 26, 266, 9, 276, 28, 19, 29, 296, 10, 306, 31, 21, 32, 326
Offset: 0

Views

Author

Keywords

Comments

The 5x+1 problem is as follows: start with any number n. If gcd(n,6)>1, divide it by gcd(n,6), otherwise multiply it by 5 and add 1. Do we always reach 1? This is an unsolved problem. It is conjectured that the answer is yes.

Crossrefs

Programs

  • Mathematica
    f[n_]:=If[GCD[n,6]>1,n/GCD[n,6],5*n+1]; Table[f[n],{n,0,100}]
  • PARI
    a(n) = my(g = gcd(n, 6)); if (g>1, n/g, 5*n+1); \\ Michel Marcus, Dec 09 2021
    
  • Python
    from math import gcd
    def A350034(n): return n//g if (g:=gcd(n,6)) > 1 else 5*n+1 # Chai Wah Wu, Dec 29 2021

Formula

a(n) = 2*a(n-6) - a(n-12). - Wesley Ivan Hurt, Oct 20 2022
Sum_{k=1..n} a(k) ~ (23/24)*n^2. - Amiram Eldar, Oct 07 2023