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.

Previous Showing 11-14 of 14 results.

A372352 The difference between n and the largest term of A086893 <= n.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6
Offset: 1

Views

Author

Antti Karttunen (proposed by Ali Sada), Apr 29 2024

Keywords

Comments

The terms a(n) grow from 0 (whenever n is in A086893) by 1 until the next element of A086893 is reached. - M. F. Hasler, May 08 2025

Crossrefs

Cf. also A372286.

Programs

Formula

a(n) = n - max ( A086893 intersect [1..n] ) (= 0 iff n in A086893). - M. F. Hasler, May 08 2025

A329480 a(n) = (1 - A075677(n))/6 if 6|(A075677(n)-1) or a(n) = (A075677(n) + 1)/6 if 6|(A075677(n)+1).

Original entry on oeis.org

0, 1, 0, 2, -1, 3, 1, 4, -2, 5, 0, 6, -3, 7, 2, 8, -4, 9, -1, 10, -5, 11, 3, 12, -6, 13, 1, 14, -7, 15, 4, 16, -8, 17, -2, 18, -9, 19, 5, 20, -10, 21, 0, 22, -11, 23, 6, 24, -12, 25, -3, 26, -13, 27, 7, 28, -14, 29, 2, 30, -15, 31, 8, 32, -16, 33, -4, 34, -17
Offset: 1

Views

Author

Fabian S. Reid, Jun 07 2020

Keywords

Comments

A fractal sequence.
This sequence is related to the Collatz Problem and can be illustrated on a logarithmic spiral to determine the odd numbers in the trajectory of a natural number of the form 6x+1 or 6x-1 simply by moving forward if the integer is positive, backward if the integer is negative, and continuing this forward-backward movement indefinitely.
When formatted as a table T with 4 columns, the third column T(n,3) is equal to the sequence. - Ruud H.G. van Tol, Oct 16 2023

Examples

			For n = 2, A075677(2) = 5, so a(2) = 1.
For n = 9, A075677(9) = 13, so a(9) = -2.
From _Ruud H.G. van Tol_, Oct 16 2023: (Start)
Array T begins:
 n|k_1|__2|__3|__4|
 1|  0   1   0   2
 2| -1   3   1   4
 3| -2   5   0   6
 4| -3   7   2   8
 5| -4   9  -1  10
 6| -5  11   3  12
... (End)
		

Crossrefs

Programs

  • Mathematica
    nterms=100;Table[r=(c=3(2n-1)+1)/2^IntegerExponent[c,2];If[Mod[r,6]==1,(1-r)/6,(1+r)/6],{n, nterms}] (* Paolo Xausa, Nov 28 2021 *)
  • PARI
    a(n) = my(x=3*n-1); x>>=valuation(x, 2); if(1==x%6, 1-x, 1+x)/6; \\ Ruud H.G. van Tol, Oct 16 2023

Formula

a(n) = (1 - A075677(n))/6 when 1 = A075677(n) mod 6, or
a(n) = (A075677(n) + 1)/6 when 5 = A075677(n) mod 6.
From Ruud H.G. van Tol, Oct 16 2023: (Start)
a(4*n-1) = a(n).
T(n,1) = 1-n; T(n,2) = 2*n-1 = n - T(n,1); T(n,3) = T(floor((n-1)/4) + 1, (n-1) mod 4 + 1) = a(n); T(n,4) = 2*n = T(n,2) + 1. (End)

A375961 2-adic valuation of 6*n + 2.

Original entry on oeis.org

1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 9, 1
Offset: 0

Views

Author

Ruud H.G. van Tol, Sep 04 2024

Keywords

Comments

6*i+2 is the first (3*x+1)/2 successor of 4*i+1, with i >= 0.
The first occurrence of odd t is before that of t-1.

Examples

			a(21) = A007814(6*21+2) = 7.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerExponent[6*n + 2, 2]; Array[a, 100, 0] (* Amiram Eldar, Sep 04 2024 *)
  • PARI
    a(n) = valuation(6*n+2, 2);
    
  • Python
    def A375961(n): return (~(3*n+1)&3*n).bit_length()+1 # Chai Wah Wu, Sep 27 2024

Formula

a(n) = A007814(6*n + 2).
a(n) = A371093(n) + 1.
a(n) = A087229(n) - 1.
a(n) = k for n == A096773(k) (mod 2^k), k >= 1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Oct 01 2024

A364602 Triangle T(n,k) with rows of length 2*n-1, generated by T(1,1)=0, T(n,1)=T(n-1,1)+2, T(n,2)=4*(n-1)-1, and for k>=3, T(n,k)=4*T(n-1,k-2)+1.

Original entry on oeis.org

0, 2, 3, 1, 4, 7, 9, 13, 5, 6, 11, 17, 29, 37, 53, 21, 8, 15, 25, 45, 69, 117, 149, 213, 85, 10, 19, 33, 61, 101, 181, 277, 469, 597, 853, 341, 12, 23, 41, 77, 133, 245, 405, 725, 1109, 1877, 2389, 3413, 1365, 14, 27, 49, 93, 165, 309, 533, 981, 1621, 2901
Offset: 1

Views

Author

Ruud H.G. van Tol, Jul 29 2023

Keywords

Comments

The sequence is a permutation of all integers >= 0.
Each row of T contains n*2-1 terms; the terms in column k increase by 2^k.
T(1,1) = 0; T(2,2) = 3.
T(2,1) = T(1,1)+2 = 2; T(2,3) = 4*T(1,1)+1 = 1 ("knight jump").
In the context of the 3x+1 problem, when a term x is used to represent the odd 4*x+1, its successor is 3*x+1, and k-1 is the 2-adic valuation of 3*x+1.
Right diagonal is A002450.
The terms at the top of the columns are A096773(k), or (2^(k-1)*(3 + 2*(-1)^k) - 1)/3.
When the table is analytically continued upwards by subtracting 2^k, the first layer of values are -A255138(k), or -(2^k*(3 + 2*(-1)^k) + 1)/3.

Examples

			Triangle T(n,k) begins:
n/k 1| 2| 3| 4|  5|  6|  7|  8|  9| 10| 11|
1|  0
2|  2  3  1
3|  4  7  9 13   5
4|  6 11 17 29  37  53  21
5|  8 15 25 45  69 117 149 213  85
6| 10 19 33 61 101 181 277 469 597 853 341
7| 12 ...
		

Crossrefs

Programs

  • PARI
    my(N=8, v=Vec([0, 2, 3, 1], N^2), p=4); for(n=3, N, my(K=2*n-1); for(k=1, K, v[p+k]=if(k<=2, v[p-K+k+2]+2^k, 4*v[p-K+k]+1)); p+=K); v
    
  • PARI
    T(n, k) = 2^k*(n-(6*k+3-(-1)^k)/12)-1/3;
    
  • PARI
    n_of_x(x) = my(n=0); while(1==x%4, x>>=2; n++); n + if(x%2,(x+1)/4,  x/2) + 1;
    
  • PARI
    k_of_x(x) = valuation(3*x+1,2) + 1;

Formula

For n>1, T(n,k) = T(n-1,k) + 2^k, so T(n,1) = 2*(n-1).
T(n,2) = 4*(n-1)-1 = 2*T(n,1)-1, so T(2,2) = 3.
For n>1 and k>2, T(n,k) = 4*T(n-1,k-2)+1, so T(2,3) = 1.
For i>=0, a(i^2+1) = T(i+1,1).
T(n, k) = 2^k * (n - (6*k + 3 - (-1)^k)/12) - 1/3.
T(n,1) == 0 (mod 2); T(n,2) == 3 (mod 4); T(n,k>=3) == 1 (mod 4).
k = v2(3*T(n,k)+1) + 1, where v2(x) = A007814(x) is the 2-adic valuation of x.
Previous Showing 11-14 of 14 results.