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-5 of 5 results.

A246200 Self-inverse permutation of natural numbers: a(n) = A057889(3*n) / 3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 27 2014

Keywords

Comments

In binary system, 3 ("11" in binary), has a similar shortcut rule for divisibility as eleven has in decimal system. This rule doesn't depend on which end of the number representation it is applied from, thus, if we reverse the number 3*n with "balanced bit-reverse" (A057889), the result should still be divisible by 3. Moreover, because the reversing operation is itself a self-inverse involution, and the prime factorization of any natural number is unique, we get a self-inverse permutation of nonnegative integers when we divide the bit-reversed result with 3.

Crossrefs

Programs

  • Python
    def a057889(n):
        x=bin(n)[2:]
        y=x[::-1]
        return int(str(int(y))+(len(x) - len(str(int(y))))*'0', 2)
    def a(n): return a057889(3*n)//3
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 11 2017
  • Scheme
    (define (A246200 n) (/ (A057889 (* 3 n)) 3))
    

Formula

a(n) = A057889(3*n) / 3.

A083822 a(n) = digit reversal of 3*n, divided by 3.

Original entry on oeis.org

1, 2, 3, 7, 17, 27, 4, 14, 24, 1, 11, 21, 31, 8, 18, 28, 5, 15, 25, 2, 12, 22, 32, 9, 19, 29, 6, 16, 26, 3, 13, 23, 33, 67, 167, 267, 37, 137, 237, 7, 107, 207, 307, 77, 177, 277, 47, 147, 247, 17, 117, 217, 317, 87, 187, 287, 57, 157, 257, 27, 127, 227, 327, 97, 197, 297, 34
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 08 2003

Keywords

Comments

If n is a multiple of 10, then a(n) = a(n/10); if n is not a multiple of 10, then a(a(n)) = n.

Examples

			a(25) = reverse(3*25)/3 = reverse(75)/3 = 57/3 = 19.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[3n]]]/3,{n,70}] (* Harvey P. Dale, May 19 2015 *)
    IntegerReverse[3*Range[70]]/3 (* Harvey P. Dale, Apr 12 2022 *)
  • PARI
    {for(n=1,70,k=3*n; rev=0; while(k>0,d=divrem(k,10); k=d[1]; rev=10*rev+d[2]); print1(rev/3,","))}
    
  • PARI
    apply( A083822(n)=fromdigits(Vecrev(digits(3*n)))/3, [0..99]) \\ M. F. Hasler, May 21 2021

Extensions

Edited, corrected and extended by Klaus Brockhaus, May 11 2003

A083823 a(1) = 15; then numbers obtained at every stage of division by 3 in the following process: multiply by 3, reverse the digits, divide by 3, reverse the digits, multiply by 3, reverse the digit, divide by 3.

Original entry on oeis.org

15, 18, 114, 1107, 11004, 110007, 1100004, 11000007, 110000004, 1100000007, 11000000004, 110000000007, 1100000000004, 11000000000007, 110000000000004, 1100000000000007, 11000000000000004, 110000000000000007, 1100000000000000004, 11000000000000000007
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 08 2003

Keywords

Comments

1. 15 is the smallest number which does not follow a cyclic pattern or terminates at k < 10. 2. A pattern is visible. For 12 one gets the cyclic pattern 12->36->63->21->12->36... for 14 one gets 14 ->42->24->8->8... Subsidiary sequences that could be considered: (1) Sequence of numbers which show cyclic pattern. (2) Sequence of numbers which terminate at k,k <10. (3) Numbers which gare not members of (1) and (2).

Examples

			*15->45->54->*18->81->243->342->*114->411->1233->3321->*1107->7011->21033->33012->*11004->
Numbers marked with * are members.
		

Crossrefs

A083825 a(1) = 12; then numbers obtained at every stage of division by 9 in the following process. multiply by 9, reverse the digits, divide by 9, reverse the digits, multiply by 9, reverse the digit, divide by 9, ...

Original entry on oeis.org

12, 89, 32, 78, 43, 67, 54, 56, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 09 2003

Keywords

Comments

The interesting pattern of terminating at 65 after which every term is 65 is visible. 89 onwards alternate terms are obtained by subtracting 11 and 32 onwards alternate terms are obtained by adding 11 and both terminate at 65. Conjecture: Every such sequence for an n-digit number not divisible by 10 terminates in another n-digit number. Let it be t(n), then one also gets t(10k) =t(k). E.g. t(12) = 65. Subsidiary sequence:(1) a(n) = t(n), a(10k) = a(k). (2). The index of the first occurrence of t(n). A measure of the length of the cycle.

Examples

			*12--->108--->801--->*89--->98--->882---288-->*32--->23--->207--->702--->*78--->87--->783--->387--->*43--->34--->306--->603--->*67--->76...
		

Crossrefs

A343639 a(n) = (Sum of digits of 9*n) / 9.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

M. F. Hasler, May 19 2021

Keywords

Comments

Similar to, but different from A193582, A326307, ...
Consider g = A008585 = multiply by 3, and its left inverse h = A002264, h o g = id (but g o h = id only on (the range of) A008585). In the spirit of group theory, we can write ad(g) = (x -> h o x o g), then A343638 = ad(A008585)(A007953) and this A343639 = ad(A008585)(A343638) = ad(A008585)^2 (A007953).

Crossrefs

Cf. A007953 (digit sum), A008591 (9n), A343638 (similar for 3), A083824 (9*n reversed and divided by 9), A279777 (a(n)=3).

Programs

  • Mathematica
    a[n_] := Plus @@ IntegerDigits[9*n]/9; Array[a, 100, 0] (* Amiram Eldar, May 19 2021 *)
  • PARI
    A343639(n)=sumdigits(9*n)/9

Formula

a(n) = A007953(A008591(n))/9, by definition. - Felix Fröhlich, May 19 2021
a(n) = A343638(3*n)/3 = A002264(A343638(A008585(n))), i.e., A343639 = A002264 o A343638 o A008585 (just as A343638 = A002264 o A007953 o A008585).
Showing 1-5 of 5 results.