login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071770 Tersum n + [n/3] (answer recorded in base 10). 2
0, 1, 2, 4, 5, 3, 8, 6, 7, 12, 13, 14, 16, 17, 15, 11, 9, 10, 24, 25, 26, 19, 20, 18, 23, 21, 22, 36, 37, 38, 40, 41, 39, 44, 42, 43, 48, 49, 50, 52, 53, 51, 47, 45, 46, 33, 34, 35, 28, 29, 27, 32, 30, 31, 72, 73, 74, 76, 77, 75, 80, 78, 79, 57, 58, 59, 61, 62, 60, 56, 54, 55, 69, 70 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
P. Mathonet, M. Rigo, M. Stipulanti and N. Zénaïdi, On digital sequences associated with Pascal's triangle, arXiv:2201.06636 [math.NT], 2022.
FORMULA
Tersum m + n: write m and n in base 3 and add mod 3 with no carries, e.g. 5 + 8 = "21" + "22" = "10" = 1. See A004482 for references.
MAPLE
a:= n-> (l-> add(irem(l[i]+l[i-1], 3)*3^(i-2),
i=2..nops(l)))([convert(n, base, 3)[], 0]):
seq(a(n), n=0..73); # Alois P. Heinz, Aug 07 2024
PROG
(PARI) a(n)={if(n==0, 0, fromdigits((digits(n, 3) + concat([0], digits(n\3, 3)))%3, 3))} \\ Andrew Howroyd, Aug 06 2024
(Python)
from sympy.ntheory import digits
def a(n):
d = digits(n, 3)[1:]
return int(str(d[0]) + "".join(str((d[i]+d[i-1])%3) for i in range(1, len(d))), 3)
print([a(n) for n in range(75)]) # Michael S. Branicky, Aug 07 2024
CROSSREFS
Cf. A004482.
Inverse permutation to A370932.
Sequence in context: A099520 A327432 A159958 * A105529 A329454 A120237
KEYWORD
nonn,look,changed
AUTHOR
Paul D. Hanna, Jun 04 2002
EXTENSIONS
a(27) corrected by Sean A. Irvine, Aug 06 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 17 23:40 EDT 2024. Contains 375255 sequences. (Running on oeis4.)