login
A381466
a(0) = 4; for n > 0, a(n) = a(n-1) + n if g = 1, otherwise a(n) = n/g, where g = gcd(a(n-1), n).
13
4, 5, 7, 10, 2, 7, 13, 20, 2, 11, 21, 32, 3, 16, 7, 22, 8, 25, 43, 62, 10, 31, 53, 76, 6, 31, 57, 9, 37, 66, 5, 36, 8, 41, 75, 7, 43, 80, 19, 58, 20, 61, 103, 146, 22, 67, 113, 160, 3, 52, 25, 76, 13, 66, 9, 64, 7, 64, 29, 88, 15, 76, 31, 94, 32, 97, 163, 230, 34, 103, 173, 244
OFFSET
0,1
COMMENTS
The rules for the sequence require us to add or divide at each index. Indices at which we add are called "addition steps," resulting in terms that are greater than those indices. Indices at which we divide are called "division steps," resulting in terms which are less than those indices. Thus, a(n) is not equal to n for any n.
If a(n) < n for some n, then a(n+1) > n+1. This means that every division step is followed by an addition step.
If a(n) > n, a(n+1) > n+1, and a(n+2) > n+2 for some n, then a(n+3) < n+3. This means that there can be at most three addition steps in a row before we reach another division step.
sqrt(n/6) < a(n) <= 7*n/2 - 9/2 for all n. In particular, a(n) > 1 for all n, so this sequence never gets "boring," as described below.
a(p) > p and a(p^2) > p^2 for all odd primes p.
Terms in the lowest band of the graph are the result of division steps. As they are the result of adding zero times, we call this the "zeroth" band of the graph.
The next three bands contain terms that are the result of adding one, two, or three times, and, as such, we call them the "first," "second," and "third" bands.
If one were to use the same rule to generate this sequence with any other initial value that is congruent to 4 or 8 (mod 12), that sequence would agree with this one for all n>3.
If one were to use the same rule to generate this sequence with an initial term that is not congruent to 4 or 8 (mod 12), then it would output the number 1 before the 5th term. When a sequence follows a(n)'s rules and outputs the number 1 at some index k, one gets the following quasi-periodic behavior: 1, k+2, 1, k+4, 1, k+6, etc., and are as such "boring" sequences.
EXAMPLE
a(12) = 3 and gcd(3, 13) = 1, so a(13) = 3 + 13 = 16. gcd(16, 14) = 2, so a(14) = 14/2 = 7.
MATHEMATICA
s={4}; Do[G=GCD[s[[-1]], n]; AppendTo[s, If[G==1, s[[-1]]+n, n/G]], {n, 71}]; s (* James C. McMahon, Mar 02 2025 *)
PROG
(PARI) lista(nn) = my(v = vector(nn)); v[1] = 4; for (n=2, nn, my(g=gcd(v[n-1], n-1)); if (g==1, v[n] = v[n-1] + n-1, v[n] = (n-1)/g); ); v; \\ Michel Marcus, Feb 26 2025
(Python)
from itertools import count, islice
from math import gcd
def A381466_gen(): # generator of terms
a = 4
for n in count(1):
yield a
a = a+n if (g:=gcd(a, n))==1 else n//g
A381466_list = list(islice(A381466_gen(), 30)) # Chai Wah Wu, Mar 11 2026
CROSSREFS
Similar to A133058, A091508.
Sequence in context: A278335 A243300 A231575 * A335001 A368659 A153085
KEYWORD
nonn,look,changed
AUTHOR
Sam Chapman, Feb 24 2025
STATUS
approved