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 41-49 of 49 results.

A266189 Self-inverse permutation of nonnegative integers: a(n) = A263273(A264985(A263273(n))).

Original entry on oeis.org

0, 1, 3, 2, 4, 10, 6, 9, 12, 7, 5, 11, 8, 13, 37, 24, 28, 31, 21, 19, 57, 18, 27, 30, 15, 36, 39, 22, 16, 34, 23, 17, 35, 69, 29, 32, 25, 14, 38, 26, 40, 118, 78, 109, 112, 75, 46, 100, 72, 82, 91, 51, 85, 94, 66, 64, 192, 20, 73, 219, 60, 171, 138, 63, 55, 165, 54, 81, 84, 33, 90, 111, 48, 58, 174, 45, 108, 93, 42, 117, 120, 67, 49
Offset: 0

Views

Author

Antti Karttunen, Jan 02 2016

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{g, h}, g[x_] := x/3^IntegerExponent[x, 3]; h[x_] := x/g@ x; If[n == 0, 0, FromDigits[Reverse@ IntegerDigits[#, 3], 3] &@ g[n] h[n]]]; s = Select[f /@ Range@ 5000, OddQ]; t = Table[(s[[n + 1]] - 1)/2, {n, 0, 1000}]; Table[f@ t[[f@ n + 1]], {n, 0, 82}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A263273 *)
  • Python
    from sympy import factorint
    from sympy.ntheory.factor_ import digits
    from operator import mul
    def a030102(n): return 0 if n==0 else int(''.join(map(str, digits(n, 3)[1:][::-1])), 3)
    def a038502(n):
        f=factorint(n)
        return 1 if n==1 else reduce(mul, [1 if i==3 else i**f[i] for i in f])
    def a038500(n): return n/a038502(n)
    def a263273(n): return 0 if n==0 else a030102(a038502(n))*a038500(n)
    def a264985(n): return (a263273(2*n + 1) - 1)/2
    def a(n): return a263273(a264985(a263273(n))) # Indranil Ghosh, May 22 2017
  • Scheme
    (define (A266189 n) (A263273 (A264985 (A263273 n))))
    

Formula

a(n) = A263273(A264985(A263273(n))).
As a composition of related permutations:
a(n) = A263273(A265353(n)).
a(n) = A265354(A263273(n)).

A293445 A multiplicative encoding (base-2 compressed) for the exponents of 3 obtained when using Shevelev's algorithm for computing A053446.

Original entry on oeis.org

2, 2, 3, 12, 36, 3, 12, 24, 6, 48, 12, 20736, 82944, 12, 18, 864, 248832, 6, 20, 19906560, 59719680, 80, 8640, 720, 25920, 34560, 5, 80, 103195607040, 240, 480, 622080, 137594142720, 138240, 20, 59440669655040, 138240, 20, 14929920, 29859840, 240, 59719680, 8640, 720, 414720, 8640, 540, 447897600, 960, 46080, 34560, 59719680, 295814814232058265600, 5, 80
Offset: 1

Views

Author

Antti Karttunen, Oct 09 2017

Keywords

Examples

			A001651(5) = 7 as 7 is the fifth number not divisible by 3. According to the algorithm described in the comment of A053446 we have in the form of a "finite continued fraction"
    1 + 14
    ------ + 7
       3^1
    ---------- + 14
          3^1
    ----------------- + 7
            3^2
    ---------------------- = 1
               3^2
Cumulatively multiplying (with A019565) together the prime-numbers corresponding to 1-bits in the binary expansions of the exponents of 3 in the denominators (that are 1, 1, 2, 2, in binary 1, 1, 10, 10, with 1's in bit-positions 0 and 1), yields prime(0+1) * prime(0+1) * prime(1+1) * prime(1+1) = 2^2 * 3^2 = 36, thus a(5) = 36.
(Adapted from _Vladimir Shevelev_'s explanation in A053446.)
Another example: A001651(19) = 28 as 28 is the 19th number not divisible by 3. (1 + 28) is not a multiple of 3, so we start with (1 + 2*28) = 1+56 = 57 and proceed as:
    1 + 56
    ------ + 56                     [that is, (57/3) + 56 = 75]
       3^1
    ---------- + 56                 [that is, (75/3) + 56 = 81]
          3^1
    -----------------  = 1          [that is, (81/81) = 1]
            3^4
So we obtained exponents 1, 1, 4 (in binary "1", "1" and "100") where the 1-bits are in positions 0, 0 and 2. We form a product prime(0+1) * prime(0+1) * prime(2+1) = 2*2*5, thus a(19) = 20.
		

Crossrefs

Cf. A293446 (restricted growth transform of this sequence).
Cf. also A292265.

Programs

  • Scheme
    (define (A293445 n) (define (next_one k m) (if (zero? (modulo (+ k m) 3)) (+ k m) (+ k m m))) (let* ((u (A001651 n)) (x_init (next_one 1 u))) (let loop ((x x_init) (z (A019565 (A007949 x_init)))) (let ((r (A038502 x))) (if (= 1 r) z (let ((x_next (next_one r u))) (loop x_next (* z (A019565 (A007949 x_next))))))))))
    (define (A001651 n) (let ((x (- n 1))) (if (even? x) (+ 1 (* 3 (/ x 2))) (- (* 3 (/ (+ x 1) 2)) 1))))
    (define (A038500 n) (A000244 (A007949 n)))
    (define (A038502 n) (/ n (A038500 n)))

Formula

A048675(a(n)) = A053446(n).

A212307 Numerator of n!/3^n.

Original entry on oeis.org

1, 1, 2, 2, 8, 40, 80, 560, 4480, 4480, 44800, 492800, 1971200, 25625600, 358758400, 1793792000, 28700672000, 487911424000, 975822848000, 18540634112000, 370812682240000, 2595688775680000, 57105153064960000, 1313418520494080000, 10507348163952640000
Offset: 0

Views

Author

Keywords

Comments

Also the 3rd column of A152656 (or of A216919).

Crossrefs

Cf. A001316, A049606, A125824 (denominators), A152656, A216919.

Programs

  • Mathematica
    Table[Numerator[n!/3^n], {n, 0, 32}]
    (* or *) CoefficientList[Series[Exp[3x], {x, 0, 32}], x] // Denominator
  • PARI
    a(n) = numerator(n!/3^n); \\ Michel Marcus, Oct 30 2013

Formula

a(n) = Product_{i=1..n} A038502(i). - Tom Edgar, Mar 22 2014
a(n) = A000142(n)/A060828(n). - Ridouane Oudra, Sep 23 2024

A348934 Numbers k congruent to 1 or 5 mod 6, for which A348930(k^2) > k^2.

Original entry on oeis.org

5, 11, 17, 23, 25, 29, 41, 47, 49, 53, 55, 59, 71, 83, 85, 89, 101, 107, 113, 115, 121, 125, 131, 137, 145, 149, 167, 169, 173, 179, 187, 191, 197, 205, 227, 233, 235, 239, 245, 251, 253, 257, 263, 265, 269, 275, 281, 289, 293, 295, 311, 317, 319, 343, 347, 353, 355, 359, 361, 383, 389, 391, 401, 415, 419, 425, 431
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2021

Keywords

Comments

See comments in A348933.

Crossrefs

Programs

  • Mathematica
    s[n_] := n / 3^IntegerExponent[n, 3]; Select[Range[450], MemberQ[{1, 5}, Mod[#, 6]] && s[DivisorSigma[1, #^2]] > #^2 &] (* Amiram Eldar, Nov 04 2021 *)
  • PARI
    A038502(n) = (n/3^valuation(n, 3));
    A348930(n) = A038502(sigma(n));
    isA348934(n) = ((n%2)&&(n%3)&&(A348930(n^2)>(n^2)));

A378578 G.f. A(x) equals the series obtained by removing all factors of 3 from the coefficients in 1 + x*A(x)^3.

Original entry on oeis.org

1, 1, 1, 2, 13, 19, 52, 412, 73, 1405, 11735, 20000, 7300, 388606, 664316, 2325118, 20832709, 11815463, 95438089, 861817318, 1495813613, 5231996647, 47291366710, 3025568936, 199838851432, 1828302724054, 3320026962314, 439614522008, 73390614310810, 131344935434920, 55179693272894, 3321671735661494
Offset: 0

Views

Author

Paul D. Hanna, Jan 03 2025

Keywords

Comments

Conjecture: a(n) == binomial(3*n,n)/(2*n+1) (mod 2) for n >= 0.

Examples

			G.f.: A(x) = 1 + x + x^2 + 2*x^3 + 13*x^4 + 19*x^5 + 52*x^6 + 412*x^7 + 73*x^8 + 1405*x^9 + 11735*x^10 + 20000*x^11 + 7300*x^12 + ...
The expansion of A(x)^3 begins
A(x)^3 = 1 + 3*x + 6*x^2 + 13*x^3 + 57*x^4 + 156*x^5 + 412*x^6 + 1971*x^7 + 4215*x^8 + 11735*x^9 + 60000*x^10 + 197100*x^11 + ...
where g.f. A(x) is obtained by removing all factors of 3 from the coefficients in 1 + x*A(x)^3.
SPECIFIC VALUES.
A(t) = 8/5 at t = 0.257842038645833456558...
A(t) = 3/2 at t = 0.24869526467110689667648213094860932113462559982219...
A(t) = 4/3 at t = 0.21321674572378383093755902318049913517774115880785...
A(t) = 5/4 at t = 0.18151790234803008203317827057063199289923020437324...
A(t) = 6/5 at t = 0.15638236848650043639095127985605468995430265567872...
A(1/4) = 1.5104498750225954401497052152244291483533940069402...
A(1/5) = 1.2948177731384287040434619555644894329636242990640...
A(1/6) = 1.2192544950152148905144159115908573870687883121699...
A(1/8) = 1.1487089332444818621810139499703458742589412625833...
A(1/9) = 1.1286969902151862545955480786537992451685724113531...
PARITY OF TERMS.
The run lengths of the odd terms, which starts
[3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, ...],
appears to equal A282162 (offset 1), the first differences of the upper Wythoff sequence (A001950).
The run lengths of the even terms, which starts
[1, 2, 5, 1, 10, 1, 2, 21, 1, 2, 5, 1, 42, 1, 2, 5, 1, 10, 1, 2, 85, 1, 2, 5, 1, 10, 1, 2, 21, 1, 2, 5, 1, 170, 1, 2, 5, 1, 10, 1, 2, 21, 1, 2, 5, 1, 42, 1, 2, 5, 1, 10, 1, 2, 341, 1, 2, 5, 1, 10, 1, 2, 21, 1, 2, 5, 1, 42, 1, 2, 5, 1, 10, 1, 2, 85, 1, 2, 5, 1, 10, 1, 2, 21, 1, 2, 5, 1, 682, 1, 2, 5, 1, 10, ...],
appears to equal A085358, the runs of zeros in binomial(3*n,n)/(2*n+1) (mod 2), the records of which are given by A000975 and occur at Fibonacci numbers.
		

Crossrefs

Programs

  • PARI
    N = 30; A=vector(N+1); A[1]=1; \\ N = number of terms
    {a(n) = if(n==0,1, A[n+1] = Vec(1 + x*Ser(A)^3)[n+1]; A[n+1] = A[n+1] / 3^valuation(A[n+1], 3) )}
    for(n=0, N, print1(a(n), ", "))

Formula

a(n) = A038502( Sum_{k=0..n-1} a(k) * Sum_{j=0..n-1-k} a(j)*a(n-1-k-j) ) for n > 0 with a(0) = 1, where A038502(m) = m/3^A007949(m) and A007949(m) = 3-adic valuation of m.

A099585 Remove all 3s from prime(n) - 1.

Original entry on oeis.org

1, 2, 4, 2, 10, 4, 16, 2, 22, 28, 10, 4, 40, 14, 46, 52, 58, 20, 22, 70, 8, 26, 82, 88, 32, 100, 34, 106, 4, 112, 14, 130, 136, 46, 148, 50, 52, 2, 166, 172, 178, 20, 190, 64, 196, 22, 70, 74, 226, 76, 232, 238, 80, 250, 256, 262, 268, 10, 92, 280, 94, 292, 34, 310
Offset: 1

Views

Author

Ralf Stephan, Oct 24 2004

Keywords

Crossrefs

Equals A038502( A006093(n) ). prime(n)-1 = a(n) * 3^A099584(n).
Cf. A057023.

Programs

  • PARI
    a(n) = (prime(n)-1)/3^valuation(prime(n)-1,3)

A273893 Denominator of n/3^n.

Original entry on oeis.org

1, 3, 9, 9, 81, 243, 243, 2187, 6561, 2187, 59049, 177147, 177147, 1594323, 4782969, 4782969, 43046721, 129140163, 43046721, 1162261467, 3486784401, 3486784401, 31381059609, 94143178827, 94143178827, 847288609443, 2541865828329, 282429536481, 22876792454961
Offset: 0

Views

Author

Paul Curtz, Jun 02 2016

Keywords

Comments

The reduced values are Ms(n) = 0, 1/3, 2/9, 1/9, 4/81, 5/243, 2/243, 7/2187, 8/6561, 1/2187, ... .
Numerators: 0, 1, 2, 1, 4, ... = A038502(n).
Ms(-n) = 0, -3, -18, ... = - A036290(n).
Difference table of Ms(n):
0, 1/3, 2/9, 1/9, 4/81, 5/243, 2/243, ...
1/3, -1/9, -1/9, -5/81, -7/243, -1/81, ...
-4/9, 0, 4/81, 8/243, 4/243, ...
4/9, 4/81, -4/243, -4/243, ...
-32/81, -16/243, 0, ...
80/243, 16/243, ...
-64/243, ...
etc.
The difference table of O(n) = n/2^n (Oresme numbers) has its 0's on the main diagonal. Here the 0's appear every two rows. For n/4^n,they appear every three rows. (The denominators of O(n) are 2^A093048(n)).
All terms are powers of 3 (A000244).

Crossrefs

Programs

  • Mathematica
    Table[Denominator[n/3^n], {n, 0, 28}] (* Michael De Vlieger, Jun 03 2016 *)
  • PARI
    a(n) = denominator(n/3^n) \\ Felix Fröhlich, Jun 07 2016
  • Sage
    [1] + [3^(n-n.valuation(3)) for n in [1..30]] # Tom Edgar, Jun 02 2016
    

Formula

For n>0, a(n) = 3^(n - valuation(n,3)) = 3^(n - A007949(n)). - Tom Edgar, Jun 02 2016
a(3n+1) = 3^(3n+1), a(3n+2) = 3^(3n+2).
a(3n+6) = 27*(3n+3).
From Peter Bala, Feb 25 2019: (Start)
a(n) = 3^n/gcd(n,3^n).
O.g.f.: 1 + F(3*x) - (2/3)*F((3*x)^3) - (2/9)*F((3*x)^9) - (2/27)*F((3*x)^27) - ..., where F(x) = x/(1 - x).
O.g.f. for reciprocals: Sum_{n >= 0} x^n/a(n) = 1 + F((x/3)) + 2*( F((x/3)^3) + 3*F((x/3)^9) + 9*F((x/3)^27) + ... ). Cf. A038502. (End)

A347717 Number of states of the minimal deterministic finite automaton that accepts ternary strings that represent numbers that are divisible by n.

Original entry on oeis.org

1, 2, 2, 4, 5, 3, 7, 8, 3, 10, 11, 5, 13, 14, 6, 16, 17, 4, 19, 20, 8, 22, 23, 9, 25, 26, 4, 28, 29, 11, 31, 32, 12, 34, 35, 6, 37, 38, 14, 40, 41, 15, 43, 44, 7, 46, 47, 17, 49, 50, 18, 52, 53, 5, 55, 56, 20, 58, 59, 21, 61, 62, 9, 64, 65, 23, 67, 68, 24, 70, 71, 10, 73
Offset: 1

Views

Author

Liangzhou Chen, Sep 10 2021

Keywords

Comments

a(n) = n for all n coprime to 3.

Examples

			The minimal DFA when n=6, giving the form of transition table:
+-------+-----------+
|       | tr. func. |
| state +---+---+---+
|       | 0 | 1 | 2 |
+-------+---+---+---+
|->*A   | A | C | B | (mod 6 = 0)
+-------+---+---+---+
|   B   | A | C | B | (mod 6 = 2,4)
+-------+---+---+---+
|   C   | C | B | C | (mod 6 = 1,3,5)
+-------+---+---+---+
		

Crossrefs

Programs

  • PARI
    a(n) = n / 3^valuation(n, 3) + valuation(n, 3)

Formula

a(1) = 1, a(2) = 2, a(3n) = a(n) + 1, a(3n+1) = 3n+1, a(3n+2) = 3n+2.

A370757 a(n) is the least k > 0 such that 1/n and 1/k have equivalent repeating decimal digits.

Original entry on oeis.org

1, 1, 3, 1, 1, 6, 7, 1, 9, 1, 11, 3, 13, 7, 6, 1, 17, 18, 19, 1, 21, 22, 23, 6, 1, 26, 27, 7, 29, 3, 31, 1, 33, 17, 7, 36, 37, 19, 39, 1, 41, 42, 43, 44, 45, 23, 47, 3, 49, 1, 51, 13, 53, 54, 55, 7, 57, 29, 59, 6, 61, 31, 63, 1, 26, 66, 67, 17, 69, 7, 71, 72
Offset: 1

Views

Author

Rémy Sigrist, Feb 29 2024

Keywords

Comments

In other words, a(n) is the least k > 0 such that the fractional parts of (10^i)/n and (10^j)/k are equal for some integers i, j.
a(n) is not always a divisor of n. For example, a(65) = 26 is not a divisor of 65. - David A. Corneth, Mar 01 2024

Examples

			The first terms, alongside the decimal expansion of 1/n with its repeating decimal digits in parentheses, are:
  n   a(n)  1/n
  --  ----  -----------
   1     1  1.(0)
   2     1  0.5(0)
   3     3  0.(3)
   4     1  0.25(0)
   5     1  0.2(0)
   6     6  0.1(6)
   7     7  0.(142857)
   8     1  0.125(0)
   9     9  0.(1)
  10     1  0.1(0)
  11    11  0.(09)
  12     3  0.08(3)
  13    13  0.(076923)
  14     7  0.07(142857)
  15     6  0.0(6)
		

Crossrefs

Cf. A000265 (base-2 analog), A038502 (base-3 analog), A132739 (base-5 analog), A242603 (base-7 analog).

Programs

  • PARI
    \\ See Links section.
    
  • Python
    from itertools import count
    from sympy import multiplicity, n_order
    def A370757(n):
        m2, m5 = (~n & n-1).bit_length(), multiplicity(5,n)
        r = max(m2,m5)
        w, m = 10**r, 10**(t:=n_order(10,n2) if (n2:=(n>>m2)//5**m5)>1 else 1)-1
        c = w//n
        s = str(m*w//n-c*m).zfill(t)
        l = len(s)
        for k in count(1):
            m2, m5 = (~k & k-1).bit_length(), multiplicity(5,k)
            r = max(m2,m5)
            w, m = 10**r, 10**(t:=n_order(10,k2) if (k2:=(k>>m2)//5**m5)>1 else 1)-1
            c = w//k
            if any(s[i:]+s[:i] == str(m*w//k-c*m).zfill(t) for i in range(l)):
                return k # Chai Wah Wu, Mar 03 2024

Formula

a(n) = 1 iff n belongs to A003592.
a(10*n) = a(n).
A007732(a(n)) = A007732(n).
Previous Showing 41-49 of 49 results.