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 31-40 of 43 results. Next

A109681 "Sloping ternary numbers": write numbers in ternary under each other (right-justified), read diagonals in upward direction, convert to decimal.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Aug 08 2005

Keywords

Comments

All terms are distinct, but certain terms (see A109682) are missing.
For the terms 3^k-1 (all 2's in ternary), the diagonal is not started at the leading 2, but at the leading 1 of the following term. - Georg Fischer, Mar 13 2020

Examples

			number diagonal decimal
    0      0     0
    1      1     1
    2     12     5
   10     10     3
   11     11     4
   12     22     8
   20     20     6
   21    121    16
   22    102    11
  100    100     9
  101    101    10
  102    112    14
  110    110    12
  11.    ...   ...
  1.
  .
		

Crossrefs

Cf. A109682 (complement), A109683 (ternary version), A109684.
Cf. A102370 (base 2), A325644 (base 4), A325645 (base 5), A325692 (base 6), A325693 (base 7), A325805 (base 8), A325829 (base 9), A103205 (base 10).
Cf. A030341.

Programs

  • Haskell
    a109681 n = a109681_list !! n
    a109681_list = map (foldr (\d v -> 3 * v + d) 0) $ f a030341_tabf where
       f vss = (g 0 vss) : f (tail vss)
       g k (ws:wss) = if k < length ws then ws !! k : g (k + 1) wss else []
    -- Reinhard Zumkeller, Nov 19 2013
    
  • Maple
    t:= (n, i)-> (d-> `if`(i=0, d, t(m, i-1)))(irem(n, 3, 'm')):
    b:= (n, i)-> `if`(3^i>n, 0, t(n,i) +3*b(n+1, i+1)):
    a:= n-> b(n, 0):
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 13 2020
  • Perl
    Cf. link.

Extensions

Conjectured g.f. and recurrence removed by Georg Fischer, Mar 13 2020

A049418 3-i-sigma(n): sum of 3-infinitary divisors of n: if n=Product p(i)^r(i) and d=Product p(i)^s(i), each s(i) has a digit a<=b in its ternary expansion everywhere that the corresponding r(i) has a digit b, then d is a 3-i-divisor of n.

Original entry on oeis.org

1, 3, 4, 7, 6, 12, 8, 9, 13, 18, 12, 28, 14, 24, 24, 27, 18, 39, 20, 42, 32, 36, 24, 36, 31, 42, 28, 56, 30, 72, 32, 63, 48, 54, 48, 91, 38, 60, 56, 54, 42, 96, 44, 84, 78, 72, 48, 108, 57, 93, 72, 98, 54, 84, 72, 72, 80, 90, 60, 168, 62, 96, 104, 73, 84, 144, 68, 126, 96
Offset: 1

Views

Author

Keywords

Examples

			Let n = 28 = 2^2*7. Then a(n) = (2^2 + 2 + 1)*(7 + 1) = 56. - _Vladimir Shevelev_, May 07 2013
		

Crossrefs

Cf. A049417 (2-infinitary), A074847 (4-infinitary), A097863 (5-infinitary).

Programs

  • Haskell
    following Bower and Harris:
    a049418 1 = 1
    a049418 n = product $ zipWith f (a027748_row n) (a124010_row n) where
       f p e = product $ zipWith div
               (map (subtract 1 . (p ^)) $
                    zipWith (*) a000244_list $ map (+ 1) $ a030341_row e)
               (map (subtract 1 . (p ^)) a000244_list)
    -- Reinhard Zumkeller, Sep 18 2015
    
  • Maple
    A049418 := proc(n) option remember; local ifa,a,p,e,d,k ; ifa := ifactors(n)[2] ; a := 1 ; if nops(ifa) = 1 then p := op(1,op(1,ifa)) ; e := op(2,op(1,ifa)) ; d := convert(e,base,3) ; for k from 0 to nops(d)-1 do a := a*(p^((1+op(k+1,d))*3^k)-1)/(p^(3^k)-1) ; end do: else for d in ifa do a := a*procname( op(1,d)^op(2,d)) ; end do: return a; end if; end proc:
    seq(A049418(n),n=1..40) ; # R. J. Mathar, Oct 06 2010
  • Mathematica
    A049418[n_] := Module[{ifa = FactorInteger[n], a = 1, p, e, d, k}, If[ Length[ifa] == 1, p = ifa[[1, 1]]; e = ifa[[1, 2]]; d = Reverse[ IntegerDigits[e, 3] ]; For[k = 1, k <= Length[d], k++, a = a*(p^((1 + d[[k]])*3^(k - 1)) - 1)/(p^(3^(k - 1)) - 1)], Do[ a = a*A049418[ d[[1]]^d[[2]] ], {d, ifa}]]; Return[a] ]; A049418[1] = 1; Table[ A049418[n] , {n, 1, 69}] (* Jean-François Alcover, Jan 03 2012, after R. J. Mathar *)
  • PARI
    apply( {A049418(n)=vecprod([prod(k=1,#n=digits(f[2],3),(f[1]^(3^(#n-k)*(n[k]+1))-1)\(f[1]^3^(#n-k)-1))|f<-factor(n)~])}, [1..99]) \\ M. F. Hasler, Sep 21 2022

Formula

Multiplicative with a(p^e) = prod_{k >= 0} (p^(3^k*{d_k+1}) - 1)/(p^(3^k) - 1), where e = sum_{k >= 0} d_k 3^k (base 3 representation). - Christian G. Bower and Mitch Harris, May 20 2005. [Edited by M. F. Hasler, Sep 21 2022]
Denote P_3 = {p^3^k}, k = 0, 1, ..., p runs primes. Then every n has a unique representation of the form n = prod q_i prod (r_j)^2, where q_i, r_j are distinct elements of P_3. Using this representation, we have a(n) = prod (q_i+1)*prod ((r_j)^2+r_j+1). - Vladimir Shevelev, May 07 2013

Extensions

More terms from Naohiro Nomoto, Sep 10 2001

A163325 Pick digits at the even distance from the least significant end of the ternary expansion of n, then convert back to decimal.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Examples

			11 in ternary base (A007089) is written as '102' (1*9 + 0*3 + 2), from which we pick the "zeroth" and 2nd digits from the right, giving '12' = 1*3 + 2 = 5, thus a(11) = 5.
		

Crossrefs

A059905 is an analogous sequence for binary.

Programs

  • PARI
    a(n) = fromdigits(digits(n,9)%3,3); \\ Kevin Ryde, May 14 2020

Formula

a(0) = 0, a(n) = (n mod 3) + 3*a(floor(n/9)).
a(n) = Sum_{k>=0} {A030341(n,k)*b(k)} where b is the sequence (1,0,3,0,9,0,27,0,81,0,243,0... = A254006): powers of 3 alternating with zeros. - Philippe Deléham, Oct 22 2011
A037314(a(n)) + 3*A037314(A163326(n)) = n for all n.

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009

A242399 Write n and 3n in ternary representation and add all trits modulo 3.

Original entry on oeis.org

0, 4, 8, 12, 16, 11, 24, 19, 23, 36, 40, 44, 48, 52, 47, 33, 28, 32, 72, 76, 80, 57, 61, 56, 69, 64, 68, 108, 112, 116, 120, 124, 119, 132, 127, 131, 144, 148, 152, 156, 160, 155, 141, 136, 140, 99, 103, 107, 84, 88, 83, 96, 91, 95, 216, 220, 224, 228, 232
Offset: 0

Views

Author

Reinhard Zumkeller, May 13 2014

Keywords

Examples

			n = 25, 3*n = 75:
.  A007089(25) =  221
.  A007089(75) = 2210
.   add trits    ----
.    modulo 3    2101 = A007089(64), hence a(25) = 64.
		

Crossrefs

Programs

  • Haskell
    a242399 n = foldr (\t v -> 3 * v + t) 0 $
                      map (flip mod 3) $ zipWith (+) ([0] ++ ts) (ts ++ [0])
                where ts = a030341_row n

Formula

a(n) <= 4*n; a(m) = 4*m iff m is a term of A242407.
a(n) = A008586(n) - A242400(n).

A163326 Pick digits at the odd distance from the least significant end of the ternary expansion of n, then convert back to decimal.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Examples

			42 in ternary base (A007089) is written as '1120' (1*27 + 1*9 + 2*3 + 0), from which we pick the first and 3rd digits from the right (zero-based!), giving '12' = 1*3 + 2 = 5, thus a(42) = 5.
		

Crossrefs

A059906 is an analogous sequence for binary. Note that A037314(A163325(n)) + 3*A037314(A163326(n)) = n for all n. Cf. A007089, A163327-A163329.

Programs

  • PARI
    a(n) = fromdigits(digits(n,9)\3,3); \\ Kevin Ryde, May 15 2020

Formula

a(n) = A163325(floor(n/3))
a(n) = Sum_{k>=0} A030341(n,k)*b(k) with (b) = (0,1,0,3,0,9,0,27,0,81,0,243,0,...): powers of 3 alternating with zeros. - Philippe Deléham, Oct 22 2011

Extensions

Edited by Charles R Greathouse IV, Nov 01 2009

A262411 Lexicographically earliest sequence of distinct terms such that the ternary representations of two consecutive terms overlap.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 22 2015

Keywords

Comments

Suggested by Paul Tek's A262323;
two numbers are overlapping if a nonempty prefix of one equals a suffix of the other;
permutation of the natural numbers with inverse A262429;
A262412(n) = A007089(a(n)).

Examples

			.   n | a(n) | A262412(n)           n | a(n) | A262412(n)
. ----+------+-----------         ----+------+-------------
.                                 (25 |   26 |         222 )
.   1 |    1 |   1                 26 |   24 |          220
.   2 |    3 |   10                27 |   29 |       1002
.   3 |    4 |  11                 28 |   28 |    1001
.   4 |    5 |   12                29 |   27 |       1000
.   5 |    2 |    2                30 |   30 |     1010
.   6 |    6 |    20               31 |   31 |  1011
.   7 |    8 |   22                32 |   32 |     1012
.   8 |    7 |    21               33 |   34 |  1021
.   9 |    9 |     100             34 |   33 |     1020
.  10 |   10 |   101               35 |   37 |  1101
.  11 |   11 |     102             36 |   35 |     1022
.  12 |   12 |    110              37 |   38 |    1102
.  13 |   13 |   111               38 |   39 |   1110
.  14 |   14 |    112              39 |   36 |    1100
.  15 |   15 |     120             40 |   40 |  1111
.  16 |   16 |   121               41 |   41 |   1112
.  17 |   17 |     122             42 |   42 |    1120
.  18 |   18 |       200           43 |   43 | 1121
.  19 |   20 |     202             44 |   44 |    1122
.  20 |   19 |       201           45 |   46 | 1201
.  21 |   23 |     212             46 |   45 |    1200
.  22 |   21 |       210           47 |   49 | 1211
.  23 |   25 |      221            48 |   47 |    1202
.  24 |   22 |       211           49 |   50 |  1212
.  25 |   26 |     222             50 |   48 |    1210  .
. (26 |   24 |      220 )
		

Crossrefs

Cf. A262323, A030341, A007089, A262412 (ternary conversion), A262429 (inverse), A262435 (fixed points).
Cf. A262460.

Programs

  • Haskell
    import Data.List (inits, tails, intersect, delete, genericIndex)
    a262411 n = genericIndex a262411_list (n - 1)
    a262411_list = 1 : f [1] (drop 2 a030341_tabf) where
       f xs tss = g tss where
         g (ys:yss) | null (intersect its $ tail $ inits ys) &&
                      null (intersect tis $ init $ tails ys) = g yss
                    | otherwise = (foldr (\t v -> 3 * v + t) 0 ys) :
                                  f ys (delete ys tss)
         its = init $ tails xs; tis = tail $ inits xs

A167877 Largest m<=n such that no carry occurs when adding m to n in ternary arithmetic.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 14 2009

Keywords

Comments

A167878(n) = a(n) + n.

Crossrefs

Cf. A007089, A167831, A035327 for the decimal and binary cases.
Cf. A030341.

Programs

  • Haskell
    a167877 n = head [x | let ts = a030341_row n, x <- [n, n-1 ..],
                          all (< 3) $ zipWith (+) ts (a030341_row x)]
    -- Reinhard Zumkeller, Mar 15 2014

A261787 a(n) is the smallest nonzero number that is not a substring of n in ternary representation.

Original entry on oeis.org

1, 2, 1, 2, 2, 3, 1, 3, 1, 2, 2, 4, 2, 2, 3, 3, 3, 3, 1, 3, 1, 4, 3, 3, 1, 3, 1, 2, 2, 4, 2, 2, 4, 4, 4, 4, 2, 2, 5, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 1, 3, 1, 4, 3, 3, 1, 3, 1, 4, 4, 4, 5, 3, 3, 3, 3, 3, 1, 3, 1, 4, 3, 3, 1, 3, 1, 2, 2, 4, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 01 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a261787 x = f $ tail a030341_tabf where
       f (cs:css) = if isInfixOf cs (a030341_row x)
                       then f css else foldr (\d v -> 3 * v + d) 0 cs
    
  • PARI
    ts(n) = Str(fromdigits(digits(n, 3)));
    a(n) = my(s=ts(n), k=1); while (#strsplit(s, ts(k)) != 1, k++); k; \\ Michel Marcus, Feb 05 2022

Formula

A261789(n) = a(A261786(n)).

A262437 Triangle T(n,k): write n in base 16, reverse order of digits.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 22 2015

Keywords

Comments

Sum(T(n,k)*16^k : k = 0..A262438(n)-1) = n.

Examples

			.   n | HEX | T(n,*)        n | HEX | T(n,*)        n | HEX | T(n,*)
. ----+-----+--------     ----+-----+--------     ----+-----+--------
.   0 |   0 |  [0]         24 |  18 |  [8,1]       48 |  30 |  [0,3]
.   1 |   1 |  [1]         25 |  19 |  [9,1]       49 |  31 |  [1,3]
.   2 |   2 |  [2]         26 |  1A |  [10,1]      50 |  32 |  [2,3]
.   3 |   3 |  [3]         27 |  1B |  [11,1]      51 |  33 |  [3,3]
.   4 |   4 |  [4]         28 |  1C |  [12,1]      52 |  34 |  [4,3]
.   5 |   5 |  [5]         29 |  1D |  [13,1]      53 |  35 |  [5,3]
.   6 |   6 |  [6]         30 |  1E |  [14,1]      54 |  36 |  [6,3]
.   7 |   7 |  [7]         31 |  1F |  [15,1]      55 |  37 |  [7,3]
.   8 |   8 |  [8]         32 |  20 |  [0,2]       56 |  38 |  [8,3]
.   9 |   9 |  [9]         33 |  21 |  [1,2]       57 |  39 |  [9,3]
.  10 |   A |  [10]        34 |  22 |  [2,2]       58 |  3A |  [10,3]
.  11 |   B |  [11]        35 |  23 |  [3,2]       59 |  3B |  [11,3]
.  12 |   C |  [12]        36 |  24 |  [4,2]       60 |  3C |  [12,3]
.  13 |   D |  [13]        37 |  25 |  [5,2]       61 |  3D |  [13,3]
.  14 |   E |  [14]        38 |  26 |  [6,2]       62 |  3E |  [14,3]
.  15 |   F |  [15]        39 |  27 |  [7,2]       63 |  3F |  [15,3]
.  16 |  10 |  [0,1]       40 |  28 |  [8,2]       64 |  40 |  [0,4]
.  17 |  11 |  [1,1]       41 |  29 |  [9,2]       65 |  41 |  [1,4]
.  18 |  12 |  [2,1]       42 |  2A |  [10,2]      66 |  42 |  [2,4]
.  19 |  13 |  [3,1]       43 |  2B |  [11,2]      67 |  43 |  [3,4]
.  20 |  14 |  [4,1]       44 |  2C |  [12,2]      68 |  44 |  [4,4]
.  21 |  15 |  [5,1]       45 |  2D |  [13,2]      69 |  45 |  [5,4]
.  22 |  16 |  [6,1]       46 |  2E |  [14,2]      70 |  46 |  [6,4]
.  23 |  17 |  [7,1]       47 |  2F |  [15,2]      71 |  47 |  [7,4]
.  24 |  18 |  [8,1]       48 |  30 |  [0,3]       72 |  48 |  [8,4]  .
		

Crossrefs

Cf. A001025, A262438 (row lengths), A030308 (binary), A030341 (ternary), A031298 (decimal).

Programs

  • Haskell
    a262437 n k = a262437_tabf !! n !! k
    a262437_row n = a262437_tabf !! n
    a262437_tabf = iterate succ [0] where
       succ []      = [1]
       succ (15:hs) = 0 : succ hs
       succ (h:hs)  = (h + 1) : hs

A047354 Numbers that are congruent to {0, 1, 2} mod 7.

Original entry on oeis.org

0, 1, 2, 7, 8, 9, 14, 15, 16, 21, 22, 23, 28, 29, 30, 35, 36, 37, 42, 43, 44, 49, 50, 51, 56, 57, 58, 63, 64, 65, 70, 71, 72, 77, 78, 79, 84, 85, 86, 91, 92, 93, 98, 99, 100, 105, 106, 107, 112, 113, 114, 119, 120, 121, 126, 127, 128, 133, 134, 135, 140, 141
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A030341.
Cf. similar sequences with formula n+i*floor(n/3) listed in A281899.

Programs

  • Magma
    [n : n in [0..150] | n mod 7 in [0..2]]; // Wesley Ivan Hurt, Jun 08 2016
  • Maple
    seq(7*floor(n/3)+(n mod 3), n=0..60); # Gary Detlefs, Mar 09 2010
  • Mathematica
    Flatten[{#,#+1,#+2}&/@(7Range[0,20])]  (* Harvey P. Dale, Mar 05 2011 *)

Formula

a(n) = 7*floor(n/3)+(n mod 3), with offset 0 and a(0)=0. - Gary Detlefs, Mar 09 2010
From R. J. Mathar, Mar 29 2010: (Start)
G.f.: x^2*(1+x+5*x^2)/((1+x+x^2) * (x-1)^2).
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4. (End)
a(n+1) = Sum_{k>=0} A030341(n,k)*b(k) with b(0)=1 and b(k)=7*3^(k-1) for k>0. - Philippe Deléham, Oct 24 2011
From Wesley Ivan Hurt, Jun 08 2016: (Start)
a(n) = (21*n-33-12*cos(2*n*Pi/3)+4*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 7k-5, a(3k-1) = 7k-6, a(3k-2) = 7k-7. (End)
a(n) = n + 4*floor((n-1)/3) - 1. - Bruno Berselli, Feb 06 2017
Previous Showing 31-40 of 43 results. Next