DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Alternative Structured Concurrency
  • Jakarta EE 12: Entering the Data Age of Enterprise Java
  • Zero-Downtime Deployments for Java Apps on Kubernetes
  • Rethinking Java CRUDs With Event Sourcing and CQRS Patterns

Trending

  • AI Paradigm Shift: Analytics Without SQL
  • Dear Micromanager: Your Distrust Has a Job; It’s Just Not the One You’re Doing
  • From Indicators to Insights: Automating IOC Enrichment Using Python and Threat Feeds
  • Zero-Downtime Deployments for Java Apps on Kubernetes
  1. DZone
  2. Coding
  3. Java
  4. What is Automorphic number in Java ?

What is Automorphic number in Java ?

By 
Das Nic user avatar
Das Nic
·
Jul. 01, 15 · Interview
Likes (0)
Comment
Save
Tweet
Share
8.7K Views

Join the DZone community and get the full member experience.

Join For Free

In mathematics an automorphic number (sometimes referred to as a circular number) is a number whose square "ends" in the same digits as the number itself. 

For example, 

52 = 25, 

62 = 36,

762 = 5776, 

and 8906252 = 793212890625, 

so 5, 6, 76 and 890625 are all automorphic numbers.

And the logic behind :

int n=56;
        int d=1; int i;
        for(i=n;i>0;i=i/10)
        {
            d=d*10;
        }
        if((n*n)%d==n)
        {
            System.out.println(n+"\t"+"is Automorphic Number");
        }
        else
        {
             System.out.println(n+"\t"+"is not Automorphic Number");
            }
        }
You can check full article from Geek On Java - Hub for Java and Android 
Java (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Alternative Structured Concurrency
  • Jakarta EE 12: Entering the Data Age of Enterprise Java
  • Zero-Downtime Deployments for Java Apps on Kubernetes
  • Rethinking Java CRUDs With Event Sourcing and CQRS Patterns

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook