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.

Showing 1-6 of 6 results.

A081502 Let n = 10x + y where 0 <= y <= 9, x >= 0. Then a(n) = 3x+y.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 22 2003

Keywords

Comments

Eswaran observes that n is divisible by 7 iff repeated application of a ends at the number 7.
a(n) is divisible by 7 iff n is divisible by 7: e.g., a(7) = a(14) = a(21) = 7, a(28) = a(35) = a(42) = 14 etc. - Zak Seidov, Mar 19 2014

References

  • R. Eswaran, Test of divisibility of the number 7, Abstracts Amer. Math. Soc., 23 (No. 2, 2002), #974-00-5, p. 275.

Crossrefs

Different from A028898 for n>=100 (e.g. a(111) = 34, A029989(111) = 13).

Programs

  • Maple
    A081502 := proc(n)
        local x,y ;
        y := modp(n,10) ;
        x := iquo(n,10) ;
        3*x+y ;
    end proc:
    seq(A081502(n),n=0..120) ; # R. J. Mathar, Oct 03 2014
  • Mathematica
    Table[n - 7 * Floor[n / 10], {n, 0, 100}] (* Joshua Oliver, Dec 04 2019 *)
  • PARI
    a(n) = 3*(n\10) + (n % 10); \\ Michel Marcus, Mar 19 2014
    
  • PARI
    a(n) = [3,1]*divrem(n,10); \\ Kevin Ryde, Dec 04 2019

Formula

G.f.: -x*(6*x^9-x^8-x^7-x^6-x^5-x^4-x^3-x^2-x-1) / (x^11-x^10-x+1). - Colin Barker, Mar 19 2014
a(n) = n-7*floor(n/10). - Wesley Ivan Hurt, May 12 2016

A381607 For any nonnegative integer n with ternary expansion Sum_{k >= 0} t_k * 3^k, a(n) = Sum_{k >= 0} t_k * A000045(2*k + 2).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54
Offset: 0

Views

Author

Rémy Sigrist, Mar 01 2025

Keywords

Comments

Every nonnegative integer appears in the sequence, a finite number of times.

Examples

			42 = 3^3 + 3^2 + 2*3^1, so a(42) = A000045(8) + A000045(6) + 2*A000045(4) = 21 + 8 + 2*3 = 35.
		

Crossrefs

See A022290 for a similar sequence.

Programs

  • PARI
    a(n) = { my (t = Vecrev(digits(n, 3))); sum(k = 1, #t, t[k] * fibonacci(2*k)); }

Formula

a(A028898(A381579(n))) = n.

A360506 Read A360505(n) as if it were a base-3 string and write it in base 10.

Original entry on oeis.org

1, 7, 34, 358, 4003, 43369, 456712, 4708240, 47754961, 1339156591, 39693785002, 1169411930926, 34213667699203, 995038950807565, 28790341783585180, 829295063367580492, 23793774263808446005, 680307709052882601259, 19390954850541496025998
Offset: 1

Views

Author

N. J. A. Sloane, Feb 17 2023

Keywords

Comments

This has the same relationship to A360505 as A048435 does to A360502.
The primes in A048435 are in A360503. What are the primes in the present sequence?
Answer: The first primes are a(2) = 7, a(5) = 4003, a(13) = 34213667699203, a(57) and a(109). See A360507. - Rémy Sigrist, Feb 18 2023

Examples

			A360505(4) = 111021 and 111021_3 = 358_10 = a(4).
		

Crossrefs

Programs

  • PARI
    a(n) = fromdigits(concat([digits(k, 3) | k <- Vecrev([1..n])]), 3) \\ Rémy Sigrist, Feb 18 2023
    
  • Python
    from sympy.ntheory import digits
    def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(n, 0, -1)), 3)
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Feb 19 2023
    
  • Python
    # faster version for initial segment of sequence
    from sympy.ntheory import digits
    from itertools import count, islice
    def agen(s=""): yield from (int(s:="".join(map(str, digits(n, 3)[1:]))+s, 3) for n in count(1))
    print(list(islice(agen(), 20))) # Michael S. Branicky, Feb 19 2023
    
  • Python
    from itertools import count, islice
    def A360506_gen(): # generator of terms
        a, b, c = 3, 1, 0
        for i in count(1):
            if i >= a:
                a *= 3
            c += i*b
            yield c
            b *= a
    A360506_list = list(islice(A360506_gen(),30)) # Chai Wah Wu, Nov 08 2023

Formula

a(n) = A028898(A360505(n)). - Rémy Sigrist, Feb 18 2023

Extensions

More terms from Rémy Sigrist, Feb 18 2023

A081599 Let n = 10x + y where 0 <= y <= 9, x >= 0. Then a(n) = 8x+y.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 56, 57, 58, 59, 60, 61
Offset: 0

Views

Author

N. J. A. Sloane, Apr 22 2003

Keywords

Crossrefs

Cf. A081502. Different from A028898.

Programs

  • Magma
    k:=8; [n-(10-k)*Floor(n/10): n in [0..100]]; // Bruno Berselli, Jun 24 2014
  • Maple
    A081599 := proc(n)
        local x,y ;
        x := floor(n/10) ;
        y := modp(n,10) ;
        8*x+y ;
    end proc:
    seq(A081599(n),n=0..100) ; # R. J. Mathar, May 25 2023
  • Mathematica
    Table[n-2*Floor[n/10],{n,0,80}] (* Harvey P. Dale, Nov 07 2017 *)
  • PARI
    my(n, x, y); vector(200, n, y=(n-1)%10; x=(n-1-y)\10; 8*x+y) \\ Colin Barker, Jun 24 2014
    

Formula

G.f.: -x*(x^9 -x^8 -x^7 -x^6 -x^5 -x^4 -x^3 -x^2 -x -1) / ((x -1)^2*(x +1)*(x^4 -x^3 +x^2 -x +1)*(x^4 +x^3 +x^2 +x +1)). - Colin Barker, Jun 24 2014
a(n) = n - 2*floor(n/10). - Bruno Berselli, Jun 24 2014

A083291 Triangular array read by rows: T(n,k) = k*floor(n/10) + n mod 10, 0<=k<=n.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, 10, 11
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 23 2003

Keywords

Comments

A010879(n)=T(n,0);
A076314(0)=T(0,0), A076314(n)=T(n,1) for n>0;
A028897(n)=T(n,n) for n<=1, A028897(n)=T(n,2) for n>1;
A028898(n)=T(n,n) for n<=2, A028898(n)=T(n,3) for n>2;
A028899(n)=T(n,n) for n<=3, A028899(n)=T(n,4) for n>3;
A028900(n)=T(n,n) for n<=4, A028900(n)=T(n,5) for n>4;
A028901(n)=T(n,n) for n<=5, A028901(n)=T(n,6) for n>5;
A028902(n)=T(n,n) for n<=6, A028902(n)=T(n,7) for n>6;
A028903(n)=T(n,n) for n<=7, A028903(n)=T(n,8) for n>7;
A028904(n)=T(n,n) for n<=8, A028904(n)=T(n,9) for n>8;
T(n,n) = n for n<=9, T(n,10) = n for n>9;
A083292(n) = T(n,n).

Examples

			From _Paolo Xausa_, May 22 2024: (Start)
Triangle begins:
   [0] 0;
   [1] 1, 1;
   [2] 2, 2, 2;
   [3] 3, 3, 3, 3;
   [4] 4, 4, 4, 4, 4;
   [5] 5, 5, 5, 5, 5, 5;
   [6] 6, 6, 6, 6, 6, 6, 6;
   [7] 7, 7, 7, 7, 7, 7, 7, 7;
   [8] 8, 8, 8, 8, 8, 8, 8, 8, 8;
   [9] 9, 9, 9, 9, 9, 9, 9, 9, 9, 9;
  [10] 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
  ... (End)
		

Programs

  • Mathematica
    Table[k*Floor[n/10] + Mod[n, 10], {n, 0, 10}, {k, 0, n}]//Flatten (* Paolo Xausa, May 22 2024 *)

Extensions

Offset changed to 0 by Paolo Xausa, May 22 2024

A381608 Nonnegative integers whose ternary expansion does not contain pairs of 2's only separated by (zero or more) 1's, with offset 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93
Offset: 0

Views

Author

Rémy Sigrist, Mar 01 2025

Keywords

Comments

The ternary expansion of a(n) equals the decimal expansion of A381579(n).

Examples

			The ternary expansion of 20, "211", has no pairs of 2's, so 20 belongs to the sequence.The ternary expansion of 21, "212", has a pair of 2s only separated by 1's, so 21 does not belong to the sequence.
		

Crossrefs

Programs

  • PARI
    a(n) = { for (k = 1, oo, my (f = fibonacci(2*k)); if (f >= n, my (v = 0); while (n, while (n >= f, n -= f; v += 3^(k-1);); f = fibonacci(2*k--);); return (v););); }

Formula

a(n) = A028898(A381579(n)).
A381607(a(n)) = n.
Showing 1-6 of 6 results.