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!)
A007745 a(n) = n OR n^2 (applied to binary expansions). 8
1, 6, 11, 20, 29, 38, 55, 72, 89, 110, 123, 156, 173, 206, 239, 272, 305, 342, 379, 404, 445, 502, 535, 600, 633, 702, 731, 796, 861, 926, 991, 1056, 1121, 1190, 1259, 1332, 1405, 1446, 1527, 1640, 1721, 1774, 1851, 1980, 2029, 2158, 2223, 2352, 2417, 2550 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
MAPLE
a:= n-> Bits[Or](n, n^2):
seq(a(n), n=1..100); # Alois P. Heinz, Mar 29 2018
MATHEMATICA
(* program should not be used to extend this sequence *)
d = 15; Mb = Array[ 2^(d - #)&, d ]; Map[ Plus@@(Mb*#)&, Array[ IntegerDigits[ #, 2, d ] + IntegerDigits[ #^2, 2, d ]&, 180 ]/. (2->1) ] (* Mocquard and Bouchon *)
Table[BitOr[n, n^2], {n, 100}] (* Vladimir Joseph Stephan Orlovsky, Jul 19 2011 *)
PROG
(Haskell)
import Data.Bits ((.|.))
a007745 n = n .|. (n ^ 2) -- Reinhard Zumkeller, Apr 28 2014
(PARI) a(n) = bitor(n, n^2); \\ Michel Marcus, Mar 30 2018
(Magma) [BitwiseOr(n, n^2): n in [1..50]]; // Bruno Berselli, Mar 30 2018
CROSSREFS
Cf. A169810 (XOR), A213541 (AND), A002378.
Sequence in context: A102305 A160842 A365351 * A188556 A021011 A000382
KEYWORD
base,nonn,easy
AUTHOR
J. P. Mocquard and D. Bouchon (BOUCHON(AT)zeus.univ-poitiers.fr)
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 April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)